Replies: 4 comments
-
@IPJT Did you manage to achieve this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@IPJT any luck? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@IPJT try this hack #855 (reply in thread) |
Beta Was this translation helpful? Give feedback.
0 replies
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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: true
when 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 accountSortingStrategy
to 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
isLocked
in my customSortingStrategy
.Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions