willmcpo / body-scroll-lock

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

Fix issue in IOS 15 Safari that bottom blank bar will show up #242

Open HainanZhao opened 2 years ago

HainanZhao commented 2 years ago

This is to fix the Safari 15 bottom nav bar issue. In IOS 15, when user scroll up, the navigation bar in safari may automatically hide. However, when we call the disableBodyScroll function, the bottom nav bar will display a blank space as shown in the video below.
https://user-images.githubusercontent.com/1543197/148535472-3a61e509-ae1d-4c3e-89a7-c6c5e42004b1.mp4

By adding a "height: 100vh" on the root Html tag, this issue can be resolved.