forked from AkkomaGang/akkoma-fe
properly ignore sticky elements when calculating offset because they
technically are following main scroll
This commit is contained in:
parent
3d37b9d8e1
commit
4b050c7fa5
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ export const findOffset = (child, parent, { top = 0, left = 0 } = {}, ignorePadd
|
||||||
result.left += ignorePadding ? 0 : leftPadding
|
result.left += ignorePadding ? 0 : leftPadding
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child.offsetParent && (parent === window || parent.contains(child.offsetParent) || parent === child.offsetParent)) {
|
if (child.offsetParent && window.getComputedStyle(child.offsetParent).position !== 'sticky' && (parent === window || parent.contains(child.offsetParent) || parent === child.offsetParent)) {
|
||||||
return findOffset(child.offsetParent, parent, result, false)
|
return findOffset(child.offsetParent, parent, result, false)
|
||||||
} else {
|
} else {
|
||||||
if (parent !== window) {
|
if (parent !== window) {
|
||||||
|
|
Loading…
Reference in a new issue