浏览代码

fix(list): 虚拟列表在ios手机上,滚动条滚动到顶部会出现白屏。 #2031

suzigang 2 年之前
父节点
当前提交
fcb85a168c
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/packages/__VUE/list/index.taro.vue

+ 1 - 2
src/packages/__VUE/list/index.taro.vue

@@ -3,7 +3,6 @@
     :class="classes"
     :class="classes"
     :scroll-y="true"
     :scroll-y="true"
     :style="{ height: `${getContainerHeight}px` }"
     :style="{ height: `${getContainerHeight}px` }"
-    scroll-top="0"
     @scroll="handleScrollEvent"
     @scroll="handleScrollEvent"
     ref="list"
     ref="list"
   >
   >
@@ -84,7 +83,7 @@ export default create({
     });
     });
 
 
     const handleScrollEvent = async (e: any) => {
     const handleScrollEvent = async (e: any) => {
-      const scrollTop = e.detail ? e.detail.scrollTop : e.target.scrollTop;
+      const scrollTop = Math.max(e.detail ? e.detail.scrollTop : e.target.scrollTop, 0.1);
       state.start = Math.floor(scrollTop / props.height);
       state.start = Math.floor(scrollTop / props.height);
       if (end.value >= state.list.length) {
       if (end.value >= state.list.length) {
         emit('scroll-bottom');
         emit('scroll-bottom');