Prevent scrolling using CSS on React rendered components

前端 未结 2 1089
我寻月下人不归
我寻月下人不归 2021-02-05 12:05

So I render a component via React within my html like so:

 
  
    
${appHtml}
2条回答
  •  一生所求
    2021-02-05 12:44

    The above doesn't work for iOS mobile.

    body-scroll-lock uses a combination of CSS and JS to make it work for all devices, whilst maintaining scrollability of a target element (eg. modal).

    ie. for iOS, need to detect when the bottom or top of a target element is reached, and then stop scrolling completely

提交回复
热议问题