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

Custom events inside sortables #41

Closed
brusherru opened this issue Aug 23, 2016 · 5 comments
Closed

Custom events inside sortables #41

brusherru opened this issue Aug 23, 2016 · 5 comments

Comments

@brusherru
Copy link

Hi there!
I need to use custom events on elements inside SelectableElement. But Selectable blocks onClick events (I just can bind onMouseDown / onMouseMove and etc, but not onMouseUp or onClick).
Is there any easy way to solve it?

Thanks!

@clauderic
Copy link
Owner

clauderic commented Aug 23, 2016

Hey @brusherru, SortableElement doesn't block onClick events per se, it simply responds before your onClick events get a chance to fire since it listens to onMouseDown / onTouchStart.

You can either set a pressDelay or use a SortableHandle to work around this.

@brusherru
Copy link
Author

@clauderic,
It's a dirty and unhandy hack.
Take a look at your chrome tabs: you can drag it even you move a mouse over it (without any stop) and you can switch it by clicking (mouse up). I need to do the same thing.

@clauderic
Copy link
Owner

clauderic commented Aug 27, 2016

It's a dirty and unhandy hack.

I'm happy to review any alternative solutions you can come up with but I can't think of any.

clauderic pushed a commit that referenced this issue Sep 5, 2016
… Prevent right click from causing sort start (#46)
@clauderic
Copy link
Owner

FYI, just published 0.0.8 to npm with support for distance and shouldCancelStart. I believe both of these should help in solving the use case you had in mind. You can either pass in a minimum drag distance of 1 or selectively prevent dragging with shouldCancelStart if the event.target matches an element you want to prevent from being sorted.

@jimenmar
Copy link

jimenmar commented Jan 19, 2017

Hello I have been looking for a solution to fire an onChange event for a checkBox that is inside SortableElement.
I tried using pressDelay and shouldCancelStart but none of them help me to trigger my event.
Does anyone has experienced same issue?
Any help will be appreciate it

DimitarNestorov pushed a commit to codemotionapps/react-sortable-hoc that referenced this issue Feb 4, 2019
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

3 participants