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

"insert on hover" feature #17

Closed
erykpiast opened this issue Nov 5, 2015 · 9 comments
Closed

"insert on hover" feature #17

erykpiast opened this issue Nov 5, 2015 · 9 comments
Labels

Comments

@erykpiast
Copy link

As far as I see, inserting nested element is based on insertZone threshold currently. User has to move the mouse some distance from the left edge of the element and if this distance is above the threshold, dragged element is inserted as a child to hovered one.

We could add optional feature that allows to change (or extend) this behavior (from UX perspective): when user hovers the element, dragged one becomes its child. In my case all attempts to simulate this by changing insertZone made widget unusable (ex. when value is 0 there was no way to reorder elements).

Technically we may reuse the mechanism and create something like 'vertical insert zone'. If the mouse is close enough to the vertical center of hovered element, dragged one will become its child when dropped, otherwise elements are reordered.

See attached image for explanation.
sortable_design

What do you think?

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

I think I understand you. It is quite interesting.

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

Hi, I have it. You can try it in dev2 branch. Lok at that please and tell me it there is no bug. It looks pretty good.

@erykpiast
Copy link
Author

It's perfect, thanks! Do you plan to hide it behind some option?

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

No I am going to release it as version 2.0.0. I want to keep the code as clean as possible. So I don't want to add new variables and conditions. I think this is more intuitive behavior as that before and is not necessary to support insertZone.

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

But I need to check if it works right. Mainly if export functions does not produce wrong results e.g empty hintWrappers and so.

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

Oo there is a problem with opening closed lists. It shouldn't be opened every time.

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

Ok done, but I am not sure. List jumping up and down too quickly while dragging.

@camohub
Copy link
Owner

camohub commented Nov 5, 2015

Now this behavior is optional. You can allow it in options via insertZonePlus param. Default is false.

@erykpiast
Copy link
Author

👍

@camohub camohub closed this as completed Nov 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants