fix(switch): unregister as formElement on disconnected
This commit is contained in:
parent
24b205837e
commit
355aabc02c
2 changed files with 6 additions and 0 deletions
5
.changeset/six-camels-cross.md
Normal file
5
.changeset/six-camels-cross.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@lion/switch': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(switch) unregister on disconnectedCallback
|
||||||
|
|
@ -88,6 +88,7 @@ export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField))
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
|
super.disconnectedCallback();
|
||||||
if (this._inputNode) {
|
if (this._inputNode) {
|
||||||
this.removeEventListener('checked-changed', this.__handleButtonSwitchCheckedChanged);
|
this.removeEventListener('checked-changed', this.__handleButtonSwitchCheckedChanged);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue