kopia lustrzana https://github.com/shoelace-style/shoelace
Avoid null dereference when removing event listeners in Dropdown (#958)
rodzic
a8de02bd53
commit
8893045bf1
|
@ -346,8 +346,10 @@ export default class SlDropdown extends ShoelaceElement {
|
|||
}
|
||||
|
||||
removeOpenListeners() {
|
||||
this.panel.removeEventListener('sl-activate', this.handleMenuItemActivate);
|
||||
this.panel.removeEventListener('sl-select', this.handlePanelSelect);
|
||||
if (this.panel) {
|
||||
this.panel.removeEventListener('sl-activate', this.handleMenuItemActivate);
|
||||
this.panel.removeEventListener('sl-select', this.handlePanelSelect);
|
||||
}
|
||||
document.removeEventListener('keydown', this.handleDocumentKeyDown);
|
||||
document.removeEventListener('mousedown', this.handleDocumentMouseDown);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue