Skip to content

Commit

Permalink
fix(core): popover close strategy fix (#10779)
Browse files Browse the repository at this point in the history
  • Loading branch information
N1XUS authored Oct 23, 2023
1 parent 8e1622b commit 919abed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libs/core/src/lib/popover/popover-service/popover.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ export class PopoverService extends BasePopoverClass {

/** Closes the popover. */
close(focusActiveElement = true): void {
if (this._overlayRef && this._overlayRef.hasAttached()) {
if (this._overlayRef) {
this._overlayRef.dispose();
}

const prevState = this.isOpen;
this.isOpen = false;
if (prevState !== this.isOpen) {
this.isOpenChange.emit(this.isOpen);
}

this._focusLastActiveElementBeforeOpen(focusActiveElement);
const prevState = this.isOpen;
this.isOpen = false;
if (prevState !== this.isOpen) {
this.isOpenChange.emit(this.isOpen);
}

this._focusLastActiveElementBeforeOpen(focusActiveElement);
}

/** Opens the popover. */
Expand Down

0 comments on commit 919abed

Please sign in to comment.