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

Lack of Auto-Reversion to Default Position in 'Compact type none' Mode #109

Open
skutam opened this issue Dec 17, 2023 · 1 comment
Open

Comments

@skutam
Copy link

skutam commented Dec 17, 2023

When 'Compact type none' is selected, and we move one piece across others, they move out of the way. However, when they no longer block the moving piece, they remain in the moved position and don't return to their default position, as they should.

React Grid Layout handles this by making every element static except the one that is being dragged. However, I would like to see an option where we can create another compactType for these static elements.

In the absence of a selected compactType, it should work in a way that prompts every element to return to its original position when not obstructed by the moving element.

@llorenspujol
Copy link
Contributor

When 'Compact type none' is selected, and we move one piece across others, they move out of the way. However, when they no longer block the moving piece, they remain in the moved position and don't return to their default position, as they should.

Yes, it works exactly that way, same as React-grid-layout.

React Grid Layout handles this by making every element static except the one that is being dragged. However, I would like to see an option where we can create another compactType for these static elements.

I understand that the workaround React Grid Layout users are implementing is to set every grid item as static during the drag action... So, there is a workaround available also in Angular Grid Layout.
However, I am okay with implementing another grid compact option to support this use case, we can try and see how it feels. I also would not discard removing the non-compaction mode as it is now in the near future... for me is weird that the grid items that you are not dragging are moving constantly their positions... I find a hard time to fit this functionality into someone's use case.

In the absence of a selected compactType, it should work in a way that prompts every element to return to its original position when not obstructed by the moving element.

That would be a breaking change, and users who have no compact type would see their functionality changed. I propose adding a new option, such as 'free', 'free-lock', 'neutral', 'none'... I'm not sure, but definitely another option for now. As said, maybe in the future we might replace the non-compaction mode as it is now with the one you are suggesting, but for now, adding another option is the way to go IMO.

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

2 participants