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

Reordering elements is too precise #4

Open
adam-lynch opened this issue Apr 14, 2017 · 4 comments
Open

Reordering elements is too precise #4

adam-lynch opened this issue Apr 14, 2017 · 4 comments

Comments

@adam-lynch
Copy link
Contributor

When trying to reorder elements, it feels a little difficult / the space I need to drag the element to is too small. I could be wrong but it seems like it won't reorder until the middle of the element being dragged passes the end of the sibling, whereas alternative libraries seem to reorder when the middle of the element being dragged passes the middle of the sibling.

I guess this would be particularly annoying with longer elements.

@supraniti
Copy link
Owner

The logic implemented in the positioning algorithm is as follows:
If cursor location is above or left the element top-left point, the dragged element will be placed before it.
I am wondering what do you think should happen on the following example -
when you drag the blue item over points 1-12,
when you drag the black item over points 1-12
lmdd

@adam-lynch
Copy link
Contributor Author

If cursor location is above or left the element top-left point, the dragged element will be placed before it.

If I understand this correctly, I think it should be:

- If cursor location is above or left the element top-left point, the dragged element will be placed before it.
+ If cursor location is above or left the element center point, the dragged element will be placed before it.

I am wondering what do you think should happen on the following example -
when you drag the blue item over points 1-12,

Hmmmm, when I created this issue, I was thinking of vertical reordering. I find it a bit hard to think about dragging in this grid-like layout but hmmm... I think:

  • If the cursor is over the rectangle marked by 2, 3, 11, 12, then it would be placed after Teal.
  • If the cursor is over the rectangle marked by 1, 2, 10, 11, then it would be placed before Teal.

when you drag the black item over points 1-12

Same as above;

  • If the cursor is over the rectangle marked by 2, 3, 11, 12, then it would be placed after Teal.
  • If the cursor is over the rectangle marked by 1, 2, 10, 11, then it would be placed before Teal.

@Pravin-Parkhi
Copy link

Pravin-Parkhi commented Sep 27, 2018

@supraniti

If cursor location is above or left the element top-left point, the dragged element will be placed
before it.

This makes sense when we drag an element downward. But shouldn't we consider bottom left while dragging upward.

When movement is

  1. Top to bottom - top left
  2. Bottom to top - bottom left
  3. Left to right - top left
  4. Right to left - bottom right

@supraniti
Copy link
Owner

that's an interesting direction... and can be implemented with a little effort...
i will dig into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants