Skip to content

Commit

Permalink
Adjust selector matching for closers to account for nested dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyGiraudel committed Aug 11, 2022
1 parent 06b6d87 commit 942ba6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/a11y-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ export default class A11yDialog {
}

if (
target.matches(
`[data-a11y-dialog="${this.id}"] [data-a11y-dialog-hide], #${this.id} [data-a11y-dialog-hide], [data-a11y-dialog-hide="${this.id}"]`
)
target.matches(`
[data-a11y-dialog="${this.id}"] > [data-a11y-dialog-hide],
#${this.id} > [data-a11y-dialog-hide],
[data-a11y-dialog-hide="${this.id}"]
`)
) {
this.hide(event)
}
Expand Down

0 comments on commit 942ba6b

Please sign in to comment.