Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Drag In and Drag Out events #2198

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

Open
roy-mdr wants to merge 8 commits into SortableJS:master
base: master
Choose a base branch
Loading
from roy-mdr:drag-in-out

Conversation

@roy-mdr
Copy link

@roy-mdr roy-mdr commented Sep 2, 2022
edited
Loading

Leaved comments in this commit for code review before merge.

known isues:

  • DnD HTML5 API: If drag too fast to another browser UI element (ej. dev tools) the HTML5 DnD dragLeave event is not triggered (not an issue from this code) ... a workaround could be to force a fallback to get the element at pointer position when dragging back to the browser window.

This PR resolve #2075 #979 #460 #1468 #2159 #1269


Usage

Sortable.create(inboxEl, {
 group: 'inbox',
 onDragIn: (e) => console.log("+++++ drag in Inbox"),
 onDragOut: (e) => console.log("----- drag out Inbox"),
 onDrop: (e) => console.log("Doped!") // Somewhere inside X,Y of this sortable. Even if no onEnd event.
});

r0manchak, lovelyelfpop, Rio517, SyedMSawaid, ghiscoding, thomasfrobieter, lofcz, federico-lo-presti, difernandez, groenroos, and MortenChristiansen reacted with thumbs up emoji
Leaved comments in this commit for code review before merge.
known isues:
- DnD HTML5 API: If drag too fast to another browser UI element (ej. dev tools) the HTML5 DnD dragLeave event is not triggered (not an issue from this code) ... a workaround could be to force a fallback to get the element at pointer position when dragging back to the browser window.
Copy link
Author

roy-mdr commented Sep 3, 2022

trasherdk, lovelyelfpop, and SyedMSawaid reacted with thumbs up emoji

Before: dragIn event was only triggered when it was a valid list to drop in. However if the list was nested in another Sortable the event didn't fire again because it was already marked as valid.
After: dragIn event is triggered even if is not a valid Sortable to drop in. Now is up to the Sortable component to handle and check if the list is allowed to drop in.
onDrop event is triggered when a sortable-dragging element is dropped inside the X and Y of the Sortable element, even if there was no onEnd event triggered
Copy link

Nice!

Copy link

@roy-mdr Is it going to merge in to the main library? How long do we have to wait for it?

simone-baldini, SyedMSawaid, and thomasfrobieter reacted with thumbs up emoji

Copy link
Author

roy-mdr commented Mar 28, 2023

@roy-mdr Is it going to merge in to the main library? How long do we have to wait for it?

Unfortunately its not my decision but the original developers :/ Hopefully soon!

SyedMSawaid and thomasfrobieter reacted with confused emoji

Copy link

@owen-m1 Any idea on when it is going to merge?

P.S. If there are no core maintainers for this project right now, how about we recruit some? I would love to contribute to this library.

Copy link
Member

owen-m1 commented Jul 2, 2023

@SyedMSawaid Yeah I'm happy to add you if you'd like to contribute, I don't have a lot of time anymore

Copy link

Any updates on this PR?

strouptl reacted with thumbs up emoji

Copy link

Is anything blocking this PR to be merged?

Copy link

@owen-m1 Pushing for this PR to be merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Is there event like "dragOver" or "dragLeave" ?

AltStyle によって変換されたページ (->オリジナル) /