modal component block scroll implement
Opened this issue · 0 comments
zhangyunhai2021 commented
What problem does this feature solve?
I am implementing a function similar to the modal component. When the mask layer or modal component appears, the body is prohibited from scrolling. Since I need to deal with the problem of zooming in and out of the mobile terminal, I use position:fix
to control it, but it is required when the modal is destroyed. The page remains in its original position, so the window.scrollTo()
method is used. The problem is that after using this method, the page will scroll from the top to the original position, which is not a good experience.
What does the proposed API look like?
I want the same effect as the modal component in the ng-zorro-antd component library. How can I achieve it?