fix(SW-184): fixed implementation of useTrapFocus
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user