Repository navigation
Replies: 4 comments
|
Sorry for the late reply and thanks for recommending #855! I ended up solving this by:
Seems like the hack in #855 is indeed the path of least resistance :P
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm using the
SortableContext-component and theuseSortable-hook to build a vertically sortable list.I'm able to disable an individual SortableItem by setting
disabled: truewhen calling theuseSortable-hook for that specific item implying the item will no longer be draggable. Great!However, what I would also like to do is to be able to "lock" an item to its index. Example
items-list:When the 3rd item is dragged on top of 2 it wouldn't push the 2nd item down as it's locked. If the 3rd item is dragged on top of 1, item 3 and 1 would swap position. I hope that makes sense.
disabled-argument?I guess what I could do is the following:
onDragEnd-callback such that the "final" sorting takes the locked item mechanism into accountSortingStrategyto make sure the css-transform applied to the different items reflect where they'll end upThe issue I have with the above approach is how to access
isLockedin my customSortingStrategy.Thanks a lot in advance!
All reactions