SlTooltip call super.disconnectedCallback() (#2226)

This commit is contained in:
Daniel Liebner
2024-10-23 16:04:31 -04:00
committed by GitHub
parent b4a3b32bb0
commit 8ca1fc7749

View File

@@ -109,6 +109,7 @@ export default class SlTooltip extends ShoelaceElement {
}
disconnectedCallback() {
super.disconnectedCallback();
// Cleanup this event in case the tooltip is removed while open
this.closeWatcher?.destroy();
document.removeEventListener('keydown', this.handleDocumentKeyDown);