Skip to content

Commit

Permalink
switch to checkVisibility DOM method
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Aug 25, 2024
1 parent f0d4601 commit 675b3a6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/block-editor/src/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,11 @@ function isElementVisible( element ) {
return false;
}

const style = viewport.getComputedStyle( element );
if (
style.display === 'none' ||
style.visibility === 'hidden' ||
style.opacity === '0'
) {
return false;
}

return true;
return element.checkVisibility( {
opacityProperty: true,
contentVisibilityAuto: true,
visibilityProperty: true,
} );
}

/**
Expand Down

0 comments on commit 675b3a6

Please sign in to comment.