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

Expose more events #20

Closed
danbriggs5 opened this issue Jul 18, 2019 · 5 comments
Closed

Expose more events #20

danbriggs5 opened this issue Jul 18, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@danbriggs5
Copy link

I appreciate your focus on minimalism and sticking to just the essentials! It's a great library. I'm wondering if any of the following additions would make the cut to be added?

  1. onDragEnd event that fires regardless of whether a change occurs or not. I'm using beforeDrag to track when dragging is actually occurring and customizing the UI. But I need custom logic to determine when it stops.
  2. Send the clientX and clientY positions as part of the beforeDrag event.
  3. onMove event that includes clientX and clientY. I think 2&3 would allow for greater customization without adding any bulk to the library. Personally, I'd like to use 2&3 to change the cursor to a grabber only once the item has been dragged > 5px. Why? Because it's clickable until it's been dragged a few pixels (similar to Trello drag and drop).
@tajo
Copy link
Owner

tajo commented Jul 22, 2019

I am open to this. Agreed that this doesn't add any bulk to the library; however, it increases the API surface so not taking this lightly.

  1. Would it be called after or before onChange? Why? Maybe it should be called afterDrag to pair with beforeDrag?
  2. onChange now returns targetRect (superset of clientX and clientY), so ideally we could return the same thing in all these events.
  3. That's a good use-case that I left out initially, so I'm fine with adding that. Would onMove interact with keyboard shortcuts?

Willing to open a PR, update the documentation and add some tests? :)

@tajo tajo added the enhancement New feature or request label Aug 18, 2019
@EternallLight
Copy link

Hi @tajo
I've watched your talk at React Advanced London and thereby found this project. You've done very cool job! Mind if I take this issue?

@tajo
Copy link
Owner

tajo commented Oct 28, 2019

@EternallLight sure, thanks!

@PManager1
Copy link

Any update on this ?

@tajo
Copy link
Owner

tajo commented Jul 21, 2020

There doesn't seem to be much traction / strong need. Closing for now. Happy to discuss additions later if people have good use-cases.

@tajo tajo closed this as completed Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants