Skip to content

Commit

Permalink
fix(uui-popover-container): disable the focusout close listener (#663)
Browse files Browse the repository at this point in the history
* disable close on focus

* remove focus eventlistener
  • Loading branch information
JesmoDev authored Nov 22, 2023
1 parent 201f449 commit 23900eb
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ export class UUIPopoverContainerElement extends LitElement {
}

super.connectedCallback();

this.addEventListener('focusout', this.#onFocusOut);
this.addEventListener('beforetoggle', this.#onBeforeToggle);
}

Expand All @@ -89,15 +87,6 @@ export class UUIPopoverContainerElement extends LitElement {
this.removeEventListener('beforetoggle', this.#onBeforeToggle);
}

#onFocusOut = (event: FocusEvent) => {
// If focus is outside of the container, then the popover will close.
if (!event.relatedTarget || !this.contains(event.relatedTarget as Node)) {
// @ts-ignore - This is part of the new popover API, but typescript doesn't recognize it yet.
this.hidePopover();
this._open = false;
}
};

#onBeforeToggle = (event: any) => {
this._open = event.newState === 'open';

Expand Down

0 comments on commit 23900eb

Please sign in to comment.