-
Notifications
You must be signed in to change notification settings - Fork 33
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
Positioning of the dragged image #27
Comments
Uhm, I believe you don't have control over the ghost image. You can only enable/disable it. IFAIK, in order to control the positioning, you'd have to actually move an dragged component after the cursor via Will be happy if you prove me wrong. PS How did you make the second animation? Another browser? |
PS I actually like the ghost image being anchored to the cursor by the top-left corner. This way, it does not obscure the list. |
The second gif was made by removing this little Firefox hack from
Another solution is to just narrow the check down to something like I'll implement it in some way in the project i'm working on, just a matter of either monkey-patch/extend it or getting it inside your repo 😀 The behavior i'm looking for here is actually the default drag n' drop behavior. But i'm happy with it being optional in some way. I think it's achievable by just fetching the mouse position from the event and use it relative to the element and do something like |
Ah, so Looks like it's fully supported by everyone except IE. What happens in Firefox when you comment out only one line: the one with I'm in favor of this solution:
I'd make it opt-in, and by default it should be normal browser behavior. |
#45 is released as 3.0.0, it should cover this case. I wonder if this should be the default, though? |
Nice! 👍 I haven't had time to do any PR's for this. (Also, yes, i'm a bit lazy as well.) If you ask me i'd prefer this behaviour instead of the old one where the ghost image quickly jumps to the right. |
Hey!
I feel there's room for improvement when grabbing items. Now it always sticks element at 0,0 to the cursor in modern browsers. See gif:
Wouldn't it be smoother if the item stays at the grabbed position like this:
I'm happy to supply a PR with this, just wanted to throw the suggestion out here before to discuss possible solutions.
As i see it, there's two ways of solving it:
Add a
action
similar todetermineForeignPositionAction
where the user implements their own method to calculate where to position the item.Add an argument to
drag-sort-list
which allows setting predetermined positions. Something likeauto|top left|bottom left|center center|
etc... Very CSS like values, whereauto
positions it where grabbed.I'd prefer alternative 1, but that's probably because of laziness. Maybe there are better options than those two.
Suggestions? Thoughts?
The text was updated successfully, but these errors were encountered: