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

Force stop the drag event #134

Open
nomorethanlifeitself opened this issue Nov 24, 2022 · 0 comments
Open

Force stop the drag event #134

nomorethanlifeitself opened this issue Nov 24, 2022 · 0 comments

Comments

@nomorethanlifeitself
Copy link

nomorethanlifeitself commented Nov 24, 2022

Is it possible to stop the drag event from within the onDrag event?

 <Draggable x={10} y={10}
        onDrag={
            (event: any, gestureState: any) => {

                if (event.nativeEvent.pageX > 300) {
                    // None of these will work:
                    event.stopPropagation();
                    event.preventDefault();
                    event.stopImmediatePropagation();
                    event.nativeEvent.stopPropagation();
                    event.nativeEvent.preventDefault();
                    event.nativeEvent.stopImmediatePropagation();
                }
            }
        }
    > content </Draggable>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant