Mattias Bodlund 4 months ago
parent
commit
f08d4aa80f
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      app/javascript/application.js

+ 4
- 8
app/javascript/application.js View File

@ -547,24 +547,20 @@ function getNaturalHeight(el) {
// Save original inline styles // Save original inline styles
const prevParent = { const prevParent = {
display: el.style.display,
visibility: el.style.visibility
display: el.style.display
}; };
// Apply temporary styles to parent // Apply temporary styles to parent
el.style.display = "flex"; el.style.display = "flex";
// Also handle hidden children
// Handle hidden children
const childPrev = []; const childPrev = [];
for (let child of el.children) { for (let child of el.children) {
childPrev.push({ childPrev.push({
display: child.style.display,
visibility: child.style.visibility,
position: child.style.position
display: child.style.display
}); });
child.style.display = "block"; // let CSS decide
child.style.display = "block";
} }
// Measure // Measure


Loading…
Cancel
Save