Skip to content

Commit

Permalink
fix: update optional layer list after layer removal (#391)
Browse files Browse the repository at this point in the history
* fix: optional list instant update; Close #342

* chore: clean up

* chore: clean up

* revert: clean up
  • Loading branch information
A-Behairi authored Nov 8, 2023
1 parent 7e61ddf commit 36eb916
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion elements/layercontrol/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,23 @@ export class EOxLayerControl extends LitElement {
.titleProperty=${this.titleProperty}
.tools=${this.tools}
.unstyled=${this.unstyled}
@changed=${() => this.requestUpdate()}
@changed=${
/**
* @param {CustomEvent & {target: Element}} e
*/
(e) => {
this.requestUpdate();
if (e.target.tagName === "EOX-LAYERCONTROL-LAYER-TOOLS") {
/**
* @type Element & { requestUpdate: function }
*/
const optionalListEl = this.renderRoot.querySelector(
"eox-layercontrol-optional-list"
);
optionalListEl?.requestUpdate();
}
}
}
></eox-layercontrol-layer-list>
`
)}
Expand Down

0 comments on commit 36eb916

Please sign in to comment.