willmcpo / body-scroll-lock

Body scroll locking that just works with everything 😏
MIT License
4.04k stars 339 forks source link

disableBodyScroll with scrollY > 0 leads to a gap on Firefox Mobile #202

Open mxeff opened 3 years ago

mxeff commented 3 years ago

Browser: Firefox Mobile 81.1.1

OS: Android 10

Description: I'm building a fixed scrollable list with 60% viewport height.

Problem: When calling disableBodyScroll on the list with a scrollY-Value greater than 0, scrolling to the bottom of the fixed list leads to a gap above the html-tag.

Example: https://meowing-wry-mice.glitch.me/ (I included a timeout of 2000ms to be able to scroll before disableBodyScroll is called).

Screen_Recording_20201005-193212_Firefox

diachedelic commented 3 years ago

I can't replicate on Firefox v81 on MacOS - seems like a Firefox Mobile bug. Can you use devtools or something to find out what the gap consists of (e.g. is it margin, padding etc)?

mxeff commented 3 years ago

Sure, here you go - it doesn't seem to be a styled spacing. I'm guessing that it's caused by the sticky address bar. Screenshot_20201006-083552_Firefox

When toggling overflow: hidden on html via DevTools the gap disappears until I scroll again in the list and reach either the top or bottom end.

diachedelic commented 3 years ago

This looks very much like a bug in Firefox Mobile - if you can find a workaround we might be able to use it.

fernyherrera commented 1 year ago

Still seeing the issue, any updates or possible work around?