-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
DragEvent not passed to pull() if target is empty #1471
Comments
JivanRoquet
changed the title
Different event is passed to pull() depending on target being empty or not
DragEvent not passed to pull() if target container is empty
Mar 14, 2019
JivanRoquet
changed the title
DragEvent not passed to pull() if target container is empty
DragEvent not passed to pull() if target is empty
Mar 14, 2019
owen-m1
added a commit
that referenced
this issue
Mar 17, 2019
Solved in b483211. |
This was referenced Sep 23, 2019
elo7-developer
pushed a commit
to elo7/Sortable
that referenced
this issue
Nov 18, 2019
Runi-c
pushed a commit
to Tupperbox/Sortable
that referenced
this issue
Nov 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A series of sortable containers is created, each with the following constructor options:
In the
pull()
callback above, weconsole.log(e)
to show the event that was passed to the callback.When dragging an element from one container to a different container which already has at least one element in it, the object being logged is of the following form:
And when dragging an element from one container to a different container which is currently empty, the object being logged is of the following form:
The context of this issue is I want to tie a
e.ctrlKey
if-check to return a different value from thepull()
callback, like the following:This works great when pulling an element onto an already-filled container, but unfortunately, because of the behaviour described above, this doesn't work when pulling an element into a container which is so far still empty.
JSFiddle of the reproduction: https://jsfiddle.net/xc6hLy17/4/
In this JSFiddle, play with the elements, try to empty a container and fill it again, and check that a
DragEvent
is correctly fired when dragging an item onto a non-emptyul
container, but not when dragging an item onto an empty container.The text was updated successfully, but these errors were encountered: