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

staticGrid: false - draggable zone overlays html content (?) #1581

Closed
LordKingPin opened this issue Jan 21, 2021 · 3 comments · Fixed by #1583
Closed

staticGrid: false - draggable zone overlays html content (?) #1581

LordKingPin opened this issue Jan 21, 2021 · 3 comments · Fixed by #1583
Labels

Comments

@LordKingPin
Copy link

Subject of the issue

Im using gridstack v 0.4.0 with sortable.js.
In Gridstack i have a widget with a list, sortable.js makes the list reorderable via drag and drop.
This works like a charm :-)

I updated to v 3.1.4. The grid works great, but my sortable.js list is not working.
After many tests I found out, that when i set the option setstatic to true the sortable works.
Now when i move the mouse over an element the mouse pointer turns into an input cursor.
If setstatic is set to false and i move the mouse over an element, the cursor remains.

Every widget has a header, draggable handle is set to the header class.

I think the draggable zone is set over the complete widget element and not only on the header, so the elements in the widget will be overwritten by the drag zone.
-> See Codepens

Your environment

3.1.4 - gridstack-h5.js
Chrome 87.0.4280.141

Steps to reproduce

Gridstack 3.1.4 - staticGrid: false - Sortable in Grid dont work
https://codepen.io/LordKingPin2020/pen/ZEpZXqW

Gridstack 3.1.4 - staticGrid: true - Sortable in Grid work (but widget cant be moved :( )
https://codepen.io/LordKingPin2020/pen/ZEpZXpE

Expected behavior

Sortable should be work with staticGrid:false as in gridstack v 0.4.0

@adumesny
Copy link
Member

adumesny commented Jan 21, 2021

you might be right (header vs entire area). Did you try jq version and see if that works instead ?

@LordKingPin
Copy link
Author

jq version works:
https://codepen.io/LordKingPin2020/pen/vYXMaPB

adumesny added a commit to adumesny/gridstack.js that referenced this issue Jan 23, 2021
* fix gridstack#1581
* set draggabble to actual div handle rather than entire item so content can also respond to dragging.
* no longer need to have mousedown to check for clikc on actual drag area...
@adumesny
Copy link
Member

fixed in just released 3.1.5 - don't forget to donate if you find this lib useful!

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

Successfully merging a pull request may close this issue.

2 participants