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

When using compact , dragging a widget and placing it at a certain position is not placing it there. #2899

Open
DIBSAAA opened this issue Dec 11, 2024 · 0 comments

Comments

@DIBSAAA
Copy link

DIBSAAA commented Dec 11, 2024

Subject of the issue

I have been following the react demo as presented here https://github.com/gridstack/gridstack.js/tree/master/react. And I'm using compact after initializing the grid. This is to achieve a snaping UI and remove empty spaces in my Grid.
But when I move a widget from one position to another the main feature should be that the dragged element should take the position it is being dropped at and the other elements should re-position to compact the grid. But, in my case, the dragged widget is being moved to fill the space.
screen-capture (2).webm

Your environment

gridstack: "^11.0.1"
react: "^18.3.1"

Steps to reproduce

Clone the react demo from this https://github.com/gridstack/gridstack.js/tree/master/react and then add gridInstance.compact('compact',false); in the initGrid function after grid initialization .

Expected behavior

The expected behavior should be that the widget that gets moved into any position when compact is being applied should still take the position where it is being dropped and the other elements should switch places to fill empty spaces.

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

1 participant