-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Fixed items support for Sortable.Grid #310
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
I think there's a difference between fixed and non-draggable settings of the handle, right? Can you also upload a video of the non-draggable setting? I think on shuffling, prepending, inserting, the items should also stay on their index in one of them, for example, if Item 1 is fixed, the insertion should insert an item into position 2, not before the first one. But I'm not sure about the append one. This (and my solution also) doesn't fulfill the requirement of items staying at the end :) I couldn't think of a solution other than allowing GridItems as children of Sortable.Grid which will stay at the end. |
Yeah, there is a difference. Basically, Here is a comparison:
I don't think so. The order of items in the grid should be the same as the order of items in the data array. If you add the new item before other items causing fixed-position items position change, their position should change respectively. The order of data in the data array should be the source of truth. If you don't want to move fixed position items, you should insert the new item at the desired index and ensure that fixed-position items are kept on their previous indices.
I think that it's ok to move the items if there is nothing between them. |
This looks great! Any idea when it'll be added to a release? |
Likely tomorrow or even today. I need to add support for the |
## Description This PR fixed flex layout ordering logic that was incorrect. THe issue started to appear after changing the `reorderInsert` function in the #310 PR but was incorrectly implemented before.
# [1.4.0](v1.3.2...v1.4.0) (2025-03-23) ### Bug Fixes * Active item portal provider on web ([#312](#312)) ([d9660d2](d9660d2)) * Default keyExtractor behavior for numeric values ([#301](#301)) ([d7cf171](d7cf171)) * Flex ordering after recent changes ([#313](#313)) ([9df1fa5](9df1fa5)), closes [#310](#310) * onPress not working after disabling drag ([#307](#307)) ([d1cbdc9](d1cbdc9)), closes [#306](#306) ### Features * Active item portal to render item over all other content ([#299](#299)) ([ecfe289](ecfe289)) * Fixed items support for Sortable.Grid ([#310](#310)) ([d0cb59e](d0cb59e)), closes [#305](#305) [#999](https://github.com/MatiPl01/react-native-sortables/issues/999)
🎉 This issue has been resolved in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR adds support for fixed items for the
Sortable.Grid
component.Thanks @tpaksu for a proposed solution in #305
Example recordings
Screen.Recording.2025-03-20.at.17.01.14.mp4
Screen.Recording.2025-03-20.at.17.15.55.mp4
Example 1 code snippet
Example 2 code snippet