mirror of
https://github.com/maputnik/editor.git
synced 2026-07-27 16:27:26 +00:00
Merge pull request #726 from orangemug/fix/issue-718
Fix to not change layer key while editing layer
This commit is contained in:
@@ -772,7 +772,10 @@ export default class App extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!invalid) {
|
if (!invalid) {
|
||||||
this.setState({selectedLayerIndex});
|
this.setState({
|
||||||
|
selectedLayerIndex,
|
||||||
|
selectedLayerOriginalId: this.state.mapStyle.layers[selectedLayerIndex].id,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@@ -782,7 +785,10 @@ export default class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLayerSelect = (index) => {
|
onLayerSelect = (index) => {
|
||||||
this.setState({ selectedLayerIndex: index }, this.setStateInUrl);
|
this.setState({
|
||||||
|
selectedLayerIndex: index,
|
||||||
|
selectedLayerOriginalId: this.state.mapStyle.layers[index].id,
|
||||||
|
}, this.setStateInUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
setModal(modalName, value) {
|
setModal(modalName, value) {
|
||||||
@@ -851,7 +857,7 @@ export default class App extends React.Component {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
const layerEditor = selectedLayer ? <LayerEditor
|
const layerEditor = selectedLayer ? <LayerEditor
|
||||||
key={selectedLayer.id}
|
key={this.state.selectedLayerOriginalId}
|
||||||
layer={selectedLayer}
|
layer={selectedLayer}
|
||||||
layerIndex={this.state.selectedLayerIndex}
|
layerIndex={this.state.selectedLayerIndex}
|
||||||
isFirstLayer={this.state.selectedLayerIndex < 1}
|
isFirstLayer={this.state.selectedLayerIndex < 1}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default class FieldId extends React.Component {
|
|||||||
>
|
>
|
||||||
<InputString
|
<InputString
|
||||||
value={this.props.value}
|
value={this.props.value}
|
||||||
onChange={this.props.onChange}
|
onInput={this.props.onChange}
|
||||||
/>
|
/>
|
||||||
</Block>
|
</Block>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user