Fire event for when popup is toggled.
This commit is contained in:
@ -117,6 +117,13 @@ class TpPopup extends EventHelpers(Position(DomQuery(LitElement))) {
|
||||
this.listen(this, 'click', '_onClick');
|
||||
}
|
||||
|
||||
updated(changes) {
|
||||
// Fire event only if isOpen wasn't undefined before. Otherwise an event is fired at the first render.
|
||||
if (changes.has('isOpen') && changes.get('isOpen') !== undefined) {
|
||||
this.dispatchEvent(new CustomEvent('is-open-changed', { detail: this.isOpen, bubbles: true, composed: true }));
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
this._cleanupEvents();
|
||||
|
Reference in New Issue
Block a user