Div scrolling freezes sometimes if I use -webkit-overflow-scrolling

后端 未结 4 1797

if I use -webkit-overflow-scrolling for a scrolling div, it scrolls perfectly with native momentum. But, div itself sometimes freezes and does not respond my fi

4条回答
  •  情歌与酒
    2020-12-13 02:15

    Stable solution

    After many days to try to fix it, i saw that the problem comes from fixed body element, maybe because you don't want your users to see your page body bounce when the scroll is blocked: cf this example. When the body is fixed and you're experiencing scrolling freeze bug, if you inspect the body with Desktop Safari on you iOS device, you can see it's kind of "artificially" moving... yes webkit stuff...

    I tried all solutions listed on this threat but also on github similar issues. No one was working.

    The only stable fix for me is to use this package : body-scroll-lock and remove the fixed on your body element. Right now you can both enjoy fixed body and no scrolling freezing bugs.

    Hope it will help people who are currently creating progressive web apps on IOS.

提交回复
热议问题