WeChat Mini Programs, judge the problem that the element reaches the top of the screen and is fixed.

The structure of the

page looks roughly like this:

<page>
    <scroll-view>
        ......
        <view class="fixedbar" hidden="{{fix}}"></view>
        ......
    </scroll-view>
</page>

whether you bind the scroll event of scroll-view , or use the createIntersectionObserver interface, whether you use wx:if or hidden , there is a situation: if the finger does not leave the screen and does not stop sliding, the fixedbar will not appear immediately, and the finger must stop sliding or leave the screen.

Why is this? How to avoid this problem? Thank you ~

Apr.03,2021

the scrolling monitoring event of scroll-view always feels that the api given by Wechat is asynchronous. We also made a related requirement before, but later it was deleted because it often caused memory overflow. It is recommended not to use scroll view, page to monitor the scrolling of the current view and control the scrolling of the current view

.
Menu