Skip to content

Commit

Permalink
fix: dialog open/close condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Sep 29, 2023
1 parent 6e022e0 commit 12bd067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/sbb-dialog/sbb-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class SbbDialog implements ComponentInterface {
*/
@Method()
public async open(): Promise<void> {
if (this._state === 'closing' || !this._dialog) {
if (this._state !== 'closed' || !this._dialog) {
return;
}
this._lastFocusedElement = document.activeElement as HTMLElement;
Expand All @@ -204,7 +204,7 @@ export class SbbDialog implements ComponentInterface {
*/
@Method()
public async close(result?: any, target?: HTMLElement): Promise<any> {
if (this._state === 'opening') {
if (this._state !== 'opened') {
return;
}

Expand Down

0 comments on commit 12bd067

Please sign in to comment.