Skip to content

Commit

Permalink
Include :modal selector in base support
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus authored Mar 27, 2024
1 parent 78aeb4e commit a948757
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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 {}

Check failure on line 11 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

Empty block statement

Check failure on line 11 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

Empty block statement

export const baseSupport =
typeof globalThis === 'object' &&
// ES2019
Expand All @@ -26,6 +32,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 a948757

Please sign in to comment.