mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-26 18:30:40 +01:00
Lots of smaller fixes found in the console logs during testing.
This commit is contained in:
parent
a1dedd1aa6
commit
b8739915b2
6 changed files with 16 additions and 13 deletions
|
@ -353,7 +353,7 @@ export default class App extends React.Component {
|
|||
parsed: {
|
||||
type: "layer",
|
||||
data: {
|
||||
index,
|
||||
index: parseInt(index, 10),
|
||||
key: "id",
|
||||
message,
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ export default class App extends React.Component {
|
|||
parsed: {
|
||||
type: "layer",
|
||||
data: {
|
||||
index,
|
||||
index: parseInt(index, 10),
|
||||
key,
|
||||
message
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ export default class DocLabel extends React.Component {
|
|||
PropTypes.object,
|
||||
PropTypes.string
|
||||
]).isRequired,
|
||||
fieldSpec: PropTypes.object.isRequired,
|
||||
onToggleDoc: PropTypes.func.isRequired,
|
||||
fieldSpec: PropTypes.object,
|
||||
onToggleDoc: PropTypes.func,
|
||||
}
|
||||
|
||||
constructor (props) {
|
||||
|
|
|
@ -223,7 +223,7 @@ export default class CombiningFilterEditor extends React.Component {
|
|||
const error = errors[`filter[${idx+1}]`];
|
||||
|
||||
return (
|
||||
<>
|
||||
<div key={`block-${idx}`}>
|
||||
<FilterEditorBlock key={idx} onDelete={this.deleteFilterItem.bind(this, idx)}>
|
||||
<SingleFilterEditor
|
||||
properties={this.props.properties}
|
||||
|
@ -232,9 +232,9 @@ export default class CombiningFilterEditor extends React.Component {
|
|||
/>
|
||||
</FilterEditorBlock>
|
||||
{error &&
|
||||
<div className="maputnik-inline-error">{error.message}</div>
|
||||
<div key="error" className="maputnik-inline-error">{error.message}</div>
|
||||
}
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ class StringInput extends React.Component {
|
|||
value: props.value
|
||||
};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
@ -10,7 +10,7 @@ class LayerIdBlock extends React.Component {
|
|||
value: PropTypes.string.isRequired,
|
||||
wdKey: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
error: PropTypes.object.isRequired,
|
||||
error: PropTypes.object,
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
@ -165,10 +165,12 @@ class LayerListContainer extends React.Component {
|
|||
return propsChanged;
|
||||
}
|
||||
|
||||
componentDidUpdate () {
|
||||
const selectedItemNode = this.selectedItemRef.current;
|
||||
if (selectedItemNode && selectedItemNode.node) {
|
||||
selectedItemNode.node.scrollIntoView();
|
||||
componentDidUpdate (prevProps) {
|
||||
if (prevProps.selectedLayerIndex !== this.props.selectedLayerIndex) {
|
||||
const selectedItemNode = this.selectedItemRef.current;
|
||||
if (selectedItemNode && selectedItemNode.node) {
|
||||
selectedItemNode.node.scrollIntoView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +186,7 @@ class LayerListContainer extends React.Component {
|
|||
if(layers.length > 1) {
|
||||
const grp = <LayerListGroup
|
||||
data-wd-key={[groupPrefix, idx].join('-')}
|
||||
key={`group-${groupPrefix}`}
|
||||
key={`group-${groupPrefix}-${idx}`}
|
||||
title={groupPrefix}
|
||||
isActive={!this.isCollapsed(groupPrefix, idx) || idx === this.props.selectedLayerIndex}
|
||||
onActiveToggle={this.toggleLayerGroup.bind(this, groupPrefix, idx)}
|
||||
|
|
Loading…
Reference in a new issue