Skip to content

e.preventDefault() not working? #81

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

Closed
quilkin opened this issue Mar 28, 2023 · 1 comment
Closed

e.preventDefault() not working? #81

quilkin opened this issue Mar 28, 2023 · 1 comment

Comments

@quilkin
Copy link

quilkin commented Mar 28, 2023

I am trying to stop a drag from list A to list B (drags from B to A are allowed). I have tried handling both the move and the end events, but cannot prevent them:
function checkMove(e) { var c = e.cancelable; if (e.to.dataset.list == "startGrid") e.preventDefault(); }
the debugger clearly shows 'preventDefault' being reached, but the move still ocurs. This seems pretty basic; what am I doing wrong here?

@MaxLeiter
Copy link
Owner

MaxLeiter commented Mar 31, 2023

Sorry this isn't documented well yet, but as of #56 you can pass @move.capture to the component to return false/true/etc based on your logic. See the PR description for an example.

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

2 participants