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

Its not possible to move item A at bottom of item B #1605

Closed
zgilewski opened this issue Feb 1, 2021 · 6 comments
Closed

Its not possible to move item A at bottom of item B #1605

zgilewski opened this issue Feb 1, 2021 · 6 comments
Labels

Comments

@zgilewski
Copy link

We are not able to correctly move one element below another one.

gridstack version: 2.1.0

image

We should be able to move element 1 below element 2.
Currently its not possible. The only way is to drag element 2 above element 1.

@adumesny
Copy link
Member

adumesny commented Feb 1, 2021

dup of #1094, and you need to use latest rev before posting bugs as well. thanks.

@adumesny adumesny closed this as completed Feb 1, 2021
@zgilewski
Copy link
Author

Its not about latest rev, as this is also happening in gridstack demos public available as you can see on attached screen, which I think using latest version of gridstack. And it is not duplication of 1094 as this describes different behaviour, or every problems with placing elements in the grid is treated as drag heuristic issue.

@adumesny
Copy link
Member

adumesny commented Feb 1, 2021

then you need to provide a jsfiddle or other example and not expect me to replicate this for you. There are other opene bugs about hard to place below - but you say "impossile". post a specific example and I will re-open.

@zgilewski
Copy link
Author

zgilewski commented Feb 2, 2021

Hmm, but I didnt write any custom code. To check if this issue exist in gridstack lib - not in my code, I just played with demo from https://gridstackjs.com/demo/float.html. In that page just set float to false, add one more widget and try to move one below other. Nothing else is needed to reproduce this issue.

@adumesny
Copy link
Member

adumesny commented Feb 2, 2021

ha yes I can see it now, likely cause by another recent fix I made about dragging out (likely #1580).
would have been nice to see running video or steps you just gave me.

@adumesny adumesny reopened this Feb 2, 2021
@pcardinaliFTX
Copy link

Gridstack.issue.mov

here is the video as per zgilewski instructions

adumesny added a commit to adumesny/gridstack.js that referenced this issue Feb 15, 2021
big overall of the collision dectection code - you can now:
* swap items of same size vertically/horizontally when grid is full (maxRow)
***** this has been 5.5years in the making and the most asked question ****
It is now also the default in float:false as it feels more natural than pushing new row
(could add Alt-key to get either behavior of push vs swap ?)
* moving items down or up behave the same way (used to have to push WAY past to insert after)
* optimized the collision code to not do extra work multiple times and only check
if change and not tried before
* heuristics now checks for >50% past the grid mid point (taking margin into account)a

TODO part II:  handle mid point of dragged over items rather 50% of row/column
and check for the most covered when multiple items collide.

* fix gridstack#149 gridstack#1605 and partial gridstack#1094 (need better support for larger items mid point)
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

3 participants