We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c49247 commit ed137ccCopy full SHA for ed137cc
1 file changed
x-pack/plugins/maps/public/actions/layer_actions.ts
@@ -11,6 +11,7 @@ import { Query } from 'src/plugins/data/public';
11
import { MapStoreState } from '../reducers/store';
12
import {
13
createLayerInstance,
14
+ getEditState,
15
getLayerById,
16
getLayerList,
17
getLayerListRaw,
@@ -481,6 +482,11 @@ function removeLayerFromLayerList(layerId: string) {
481
482
type: REMOVE_LAYER,
483
id: layerId,
484
});
485
+ // Clean up draw state if needed
486
+ const editState = getEditState(getState());
487
+ if (layerId === editState?.layerId) {
488
+ dispatch(setDrawMode(DRAW_MODE.NONE));
489
+ }
490
};
491
}
492
0 commit comments