Last active
July 2, 2022 21:32
-
-
Save sagive/f3fa67d657b1a1936dbb5cfac3f0364a to your computer and use it in GitHub Desktop.
this helps to find out which parent has an "overflow" settings that might cause issue with sticky.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let parent = document.querySelector('.sticky').parentElement; | |
while (parent) { | |
const hasOverflow = getComputedStyle(parent).overflow; | |
if (hasOverflow !== 'visible') { | |
console.log(hasOverflow, parent); | |
} | |
parent = parent.parentElement; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment