Skip to content
Snippets Groups Projects
Commit ad8807ca authored by ambient.impact's avatar ambient.impact
Browse files

Issue #3487907: Drupal.displace() use getComputedStyle() for hidden chk.

parent 1c33460a
No related branches found
No related tags found
2 merge requests!10259Issue #3487907: Drupal.displace() use getComputedStyle() for hidden chk.,!10210Issue #3487907: Drupal.displace() use getComputedStyle() for hidden chk.
......@@ -159,8 +159,12 @@
const n = displacingElements.length;
for (let i = 0; i < n; i++) {
const el = displacingElements[i];
// If the element is not visible, do consider its dimensions.
if (el.style.display === 'none') {
// If the element is set to display: none; do not consider its dimensions.
//
// @see https://api.jquery.com/hidden-selector/
// For a more thorough implementation that considers other properties
// and whether the element has layout at all.
if (getComputedStyle(el).display === 'none') {
continue;
}
// If the offset data attribute contains a displacing value, use it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment