Skip to content

Commit

Permalink
Simplify ‘useDialog’ detection
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyGiraudel committed Feb 27, 2021
1 parent 72966b1 commit 2cc152f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
4 changes: 1 addition & 3 deletions a11y-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ function A11yDialog(node, targets) {
'dialog, [role="dialog"], [role="alertdialog"]'
)
this.role = this.dialog.getAttribute('role') || 'dialog'
this.useDialog =
'show' in document.createElement('dialog') &&
this.dialog.nodeName === 'DIALOG'
this.useDialog = 'show' in this.dialog

// Keep an object of listener types mapped to callback functions
this._listeners = {}
Expand Down
4 changes: 1 addition & 3 deletions dist/a11y-dialog.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/a11y-dialog.esm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions dist/a11y-dialog.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2cc152f

Please sign in to comment.