fix(SW-184): fixed implementation of useTrapFocus

This commit is contained in:
Erik Tiekstra
2024-08-26 08:09:32 +02:00
parent bdec054ecd
commit a02dcd3428
13 changed files with 324 additions and 79 deletions

View File

@@ -20,9 +20,19 @@ function hidesContents(element: HTMLElement) {
// Otherwise we need to check some styles
const style = window.getComputedStyle(element)
return zeroSize
? style.getPropertyValue("overflow") !== "visible"
: style.getPropertyValue("display") === "none"
console.log({
element,
zeroSize,
display: style.display,
overflow: style.overflow,
returns:
style.getPropertyValue("display") === "none" ||
(zeroSize && style.getPropertyValue("overflow") !== "visible"),
})
return (
style.getPropertyValue("display") === "none" ||
(zeroSize && style.getPropertyValue("overflow") !== "visible")
)
}
function visible(element: any) {