Giter Club home page Giter Club logo

Comments (5)

zhiqingchen avatar zhiqingchen commented on June 7, 2024

@SilentMelody Can the Click trigger logic be optimized?

from react-native-echarts.

NguyenHoangMinhkkkk avatar NguyenHoangMinhkkkk commented on June 7, 2024

@SilentMelody Can the Click trigger logic be optimized?

Thanks for reply,
i'm temporary using Scrollview onMomentumScrollBegin, onMomentumScrollEnd and a boolean Ref to prevent triggered event while scrollview is scrolling.

from react-native-echarts.

zhiqingchen avatar zhiqingchen commented on June 7, 2024

The click can be triggered at the end of the gesture, depending on the position (e.g. if it moves more than x pixels).

https://github.com/wuba/react-native-echarts/blob/main/src/components/PanResponderHandler.tsx#L97

https://github.com/wuba/react-native-echarts/blob/main/src/components/RNGestureHandler.tsx#L64

from react-native-echarts.

NguyenHoangMinhkkkk avatar NguyenHoangMinhkkkk commented on June 7, 2024

hi there.
in this example, should i use of react-native-gesture-handler instead of default of RN?
or someother way for optimize that behavior ?

from react-native-echarts.

NguyenHoangMinhkkkk avatar NguyenHoangMinhkkkk commented on June 7, 2024

src/components/PanResponderHandler.tsx#L97src/components/PanResponderHandler.tsx#L97

patch-package -> add a boolean value "isAvoidPressOnScroll" and everything working good.

onPanResponderGrant: ({ nativeEvent }) => {
    if (isAvoidPressOnScroll) dispatchEvents(['mousedown'], nativeEvent);
    else dispatchEvents(['mousedown', 'mousemove'], nativeEvent);
},

from react-native-echarts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.