From 4f77629eb7a35c89a897d932556bf0ae19774bb4 Mon Sep 17 00:00:00 2001 From: orangemug Date: Tue, 8 Sep 2020 17:58:33 +0100 Subject: [PATCH 1/2] Fix to not change layer key while editing layer. --- src/components/App.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index a88cd56..779fee4 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -772,7 +772,10 @@ export default class App extends React.Component { } } if (!invalid) { - this.setState({selectedLayerIndex}); + this.setState({ + selectedLayerIndex, + selectedLayerOriginalId: this.state.mapStyle.layers[selectedLayerIndex].id, + }); } } catch (err) { @@ -782,7 +785,10 @@ export default class App extends React.Component { } onLayerSelect = (index) => { - this.setState({ selectedLayerIndex: index }, this.setStateInUrl); + this.setState({ + selectedLayerIndex: index, + selectedLayerOriginalId: this.state.mapStyle.layers[index].id, + }, this.setStateInUrl); } setModal(modalName, value) { @@ -851,7 +857,7 @@ export default class App extends React.Component { /> const layerEditor = selectedLayer ? Date: Wed, 9 Sep 2020 20:22:52 +0100 Subject: [PATCH 2/2] onChange -> onInput for component. --- src/components/FieldId.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FieldId.jsx b/src/components/FieldId.jsx index 6a857f9..3c9f4b3 100644 --- a/src/components/FieldId.jsx +++ b/src/components/FieldId.jsx @@ -20,7 +20,7 @@ export default class FieldId extends React.Component { > }