Skip to content
New issue

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

rn android galaxy A9s View onClick 大概率不触发 #13006

Closed
hanzhangyu opened this issue Dec 20, 2022 · 0 comments · Fixed by #12857
Closed

rn android galaxy A9s View onClick 大概率不触发 #13006

hanzhangyu opened this issue Dec 20, 2022 · 0 comments · Fixed by #12857
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x

Comments

@hanzhangyu
Copy link

相关平台

React Native

image

使用框架: React

复现步骤

在目标机型下使用 taro playground 即可复现

期望结果

View 点击 onClick 事件生效

实际结果

View 点击大概率不生效

环境信息

👽 Taro v3.3.20


  Taro CLI 3.3.20 environment info:
    System:
      OS: macOS 12.3.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
      Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.1/bin/yarn
      npm: 8.5.3 - ~/.nvm/versions/node/v14.18.1/bin/npm
    npmPackages:
      @tarojs/cli: 3.4.2 => 3.4.2
      @tarojs/components: 3.4.2 => 3.4.2
      @tarojs/mini-runner: 3.4.2 => 3.4.2
      @tarojs/react: 3.4.2 => 3.4.2
      @tarojs/router: 3.4.2 => 3.4.2
      @tarojs/runtime: 3.4.2 => 3.4.2
      @tarojs/taro: 3.4.2 => 3.4.2
      @tarojs/webpack-runner: 3.4.2 => 3.4.2
      babel-preset-taro: 3.4.2 => 3.4.2
      eslint-config-taro: 3.4.2 => 3.4.2
      react: ^17.0.2 => 17.0.2
      react-native: 0.66.4 => 0.66.4

修复方式

我们临时修复了,实测下 dx 经常为 -1.9 之类的

diff --git a/node_modules/@tarojs/components-rn/dist/components/ClickableSimplified/index.js b/node_modules/@tarojs/components-rn/dist/components/ClickableSimplified/index.js
index 306dd43..9483ea1 100644
--- a/node_modules/@tarojs/components-rn/dist/components/ClickableSimplified/index.js
+++ b/node_modules/@tarojs/components-rn/dist/components/ClickableSimplified/index.js
@@ -66,7 +66,7 @@ export default function (WrappedComponent) {
                         onTouchEnd && onTouchEnd(this.getWxAppEvent(evt));
                         const endTimestamp = evt.nativeEvent.timestamp;
                         const gapTime = endTimestamp - this.startTimestamp;
-                        const hasMove = Math.abs(gestureState.dx) >= 1 || Math.abs(gestureState.dy) >= 1;
+                        const hasMove = Math.abs(gestureState.dx) >= 10 || Math.abs(gestureState.dy) >= 10;
                         if (!hasMove) {
                             if (gapTime <= 350) {
                                 onClick && onClick(this.getWxAppEvent(evt));
@taro-bot2 taro-bot2 bot added F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x labels Dec 20, 2022
@zhiqingchen zhiqingchen linked a pull request Dec 20, 2022 that will close this issue
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant