Skip to content

Commit

Permalink
fix isOnTopLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus authored Feb 22, 2024
1 parent 30403c3 commit 41dfca7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/anchored-position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@ function getPositionedParent(element: Element) {
*/
function isOnTopLayer(element: Element) {
if (element.tagName === 'DIALOG') {
return true
return element.matches(':modal')
}
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (element.matches(':popover-open') && /native code/.test((document.body as any).showPopover?.toString())) {
return true
}
} catch {
return false
// ignore
}
return false
return element.matches(':fullscreen')
}

/**
Expand Down

0 comments on commit 41dfca7

Please sign in to comment.