backport SL-2226

This commit is contained in:
Cory LaViska
2024-10-23 16:07:54 -04:00
parent 1456b37915
commit e48243b492
2 changed files with 3 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ During the alpha period, things might break! We take breaking changes very serio
- Fixed a bug in `<wa-relative-time>` where the title attribute would show with redundant info
- Added more resilient support for lazy loaded options in `<wa-select>`
- Fixed a bug in `<wa-tooltip>` that caused a memory leak in disconnected elements
## 3.0.0-alpha.3

View File

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