提交 7e3ce112 编写于 作者: D DCloud_LXH

fix: chrome passive Violation

上级 e9585a8e
...@@ -488,8 +488,7 @@ function useScrollViewLoader( ...@@ -488,8 +488,7 @@ function useScrollViewLoader(
}) })
_scrollIntoViewChanged(props.scrollIntoView) _scrollIntoViewChanged(props.scrollIntoView)
let __handleScroll = function (event: Event) { let __handleScroll = function (event: Event) {
// Unable to preventDefault inside passive event listener invocation. event.preventDefault()
// event.preventDefault();
event.stopPropagation() event.stopPropagation()
_handleScroll(event as MouseEvent) _handleScroll(event as MouseEvent)
} }
...@@ -611,8 +610,8 @@ function useScrollViewLoader( ...@@ -611,8 +610,8 @@ function useScrollViewLoader(
__handleTouchStart, __handleTouchStart,
passiveOptions passiveOptions
) )
main.value!.addEventListener('touchmove', __handleTouchMove) main.value!.addEventListener('touchmove', __handleTouchMove, passive(false))
main.value!.addEventListener('scroll', __handleScroll, passiveOptions) main.value!.addEventListener('scroll', __handleScroll, passive(false))
main.value!.addEventListener('touchend', __handleTouchEnd, passiveOptions) main.value!.addEventListener('touchend', __handleTouchEnd, passiveOptions)
initScrollBounce() initScrollBounce()
......
...@@ -12024,6 +12024,7 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber, ...@@ -12024,6 +12024,7 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber,
}); });
_scrollIntoViewChanged(props2.scrollIntoView); _scrollIntoViewChanged(props2.scrollIntoView);
let __handleScroll = function(event) { let __handleScroll = function(event) {
event.preventDefault();
event.stopPropagation(); event.stopPropagation();
_handleScroll(event); _handleScroll(event);
}; };
...@@ -12112,8 +12113,8 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber, ...@@ -12112,8 +12113,8 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber,
} }
}; };
main.value.addEventListener("touchstart", __handleTouchStart, passiveOptions); main.value.addEventListener("touchstart", __handleTouchStart, passiveOptions);
main.value.addEventListener("touchmove", __handleTouchMove); main.value.addEventListener("touchmove", __handleTouchMove, passive(false));
main.value.addEventListener("scroll", __handleScroll, passiveOptions); main.value.addEventListener("scroll", __handleScroll, passive(false));
main.value.addEventListener("touchend", __handleTouchEnd, passiveOptions); main.value.addEventListener("touchend", __handleTouchEnd, passiveOptions);
onBeforeUnmount(() => { onBeforeUnmount(() => {
main.value.removeEventListener("touchstart", __handleTouchStart); main.value.removeEventListener("touchstart", __handleTouchStart);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册