Skip to content

Instantly share code, notes, and snippets.

@sagive
Last active July 2, 2022 21:32
Show Gist options
  • Save sagive/f3fa67d657b1a1936dbb5cfac3f0364a to your computer and use it in GitHub Desktop.
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.
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