Skip to content

Commit

Permalink
Merge pull request #54 from github/Include-modal-selector-in-base-sup…
Browse files Browse the repository at this point in the history
…port

Include :modal selector in base support
  • Loading branch information
keithamus committed Mar 27, 2024
2 parents 78aeb4e + 1480d9f commit 907c491
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import * as elementCheckVisibility from './element-checkvisibility.js'
import * as navigatorClipboard from './navigator-clipboard.js'
import * as requestIdleCallback from './requestidlecallback.js'

let supportsModalPseudo = false
try {
// This will error in older browsers
supportsModalPseudo = document.body.matches(':modal') === false
} catch {
supportsModalPseudo = false
}

export const baseSupport =
typeof globalThis === 'object' &&
// ES2019
Expand All @@ -26,6 +34,7 @@ export const baseSupport =
// DOM / HTML and other specs
typeof queueMicrotask === 'function' &&
typeof HTMLDialogElement === 'function' &&
supportsModalPseudo &&
typeof AggregateError === 'function' &&
typeof BroadcastChannel === 'function' &&
'randomUUID' in crypto &&
Expand Down

0 comments on commit 907c491

Please sign in to comment.