We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlay 做了点击事件,所以会拦截 ScrollView 的触屏事件,导致卡顿。
Overlay 有属性 pointerEvents,可以控制 Overlay 是否可以作为触控事件的目标。(参考:rnx-ui/Overlay at master · rnxteam/rnx-ui)
pointerEvents
但是 Dialog 以及衍生的 Alert/Confirm 组件都未对 Overlay 进行设置,此处需要 RNX-UI 进行升级。
作为临时解救方法,在使用上述组件时,如果内部出现了 ScrollView,在其内部包裹 TouchableWithoutFeedback 并绑定处理空函数。(参考:如下)
<Alert> <ScrollView> <TouchableWithoutFeedback onPress={() => {}}> {/* content */} </TouchableWithoutFeedback> </ScrollView> </Alert>
React Native 中 Touchable* 组件事件捕获问题
The text was updated successfully, but these errors were encountered:
No branches or pull requests
原因
Overlay 做了点击事件,所以会拦截 ScrollView 的触屏事件,导致卡顿。
办法
Overlay 有属性
pointerEvents
,可以控制 Overlay 是否可以作为触控事件的目标。(参考:rnx-ui/Overlay at master · rnxteam/rnx-ui)但是 Dialog 以及衍生的 Alert/Confirm 组件都未对 Overlay 进行设置,此处需要 RNX-UI 进行升级。
作为临时解救方法,在使用上述组件时,如果内部出现了 ScrollView,在其内部包裹 TouchableWithoutFeedback 并绑定处理空函数。(参考:如下)
相关文章
React Native 中 Touchable* 组件事件捕获问题
The text was updated successfully, but these errors were encountered: