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

Issue #3487907: Drupal.displace() check Drupal.elementIsHidden():

This is more thorough and actually determines if the element is visible
or has dimensions.
parent ad8807ca
No related branches found
No related tags found
1 merge request!10259Issue #3487907: Drupal.displace() use getComputedStyle() for hidden chk.
......@@ -159,12 +159,9 @@
const n = displacingElements.length;
for (let i = 0; i < n; i++) {
const el = displacingElements[i];
// 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') {
// If the element is hidden or not visible, do not consider its
// dimensions.
if (Drupal.elementIsHidden(el)) {
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