-
Notifications
You must be signed in to change notification settings - Fork 53
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
Make one or more item inside the list fixed/locked #97
Comments
Just a thought, but could you add the first/last items as part of the |
@IanVS consider I want to fix the 4th item in my list then then it won't work. I only provided an example for better understanding but it doesn't necessary always have to be the first and last items |
In that case, it seems like you could have two lists, one above the fixed item, and one below. |
@IanVS Yes you are right, I can do that and in case of dynamically selecting the fixed item i can maintain two lists and filter out the fixed item, but in case there is more than one fixed item the amount of preprocessing that I have to do can be a bit much. Imagine a case where the 2nd, 5th, 9th and 17th (these are random by the way) items need to stay fixed and I only get to know those indexes right before render from a some fetched data. Splitting and maintaining multiple lists and rendering them above and below those fixed items is definitely not the best solution (Hopefully this gets my point across 🤞) My problem has already been solved due to architectural changes (the issue can be closed 👍), however I feel like this is something the library should handle by itself. Consider it a feature request now 🚀 |
Yeah I understand it's not an ideal workaround, but I wonder what kind of use case would involve so many "locked" cells requiring sorting only above or below them. I'd be curious to hear what kind of UI you're building where this might be needed. (note: I'm not a maintainer, just trying to help out) |
haha @IanVS your curiosity is understandable for such a situation (which by the way I am not in any more 😉). My UI consisted of a list where the end user can add as many items as they want from an available list type of items and in those items, some had to be fixed, so this was merely an edge case for me. Thanks for taking the time and interest, your help is appreciated |
I am looking for a way to make a specific item inside a list to be not draggable which is implemented using the disabled property. But the items that are not disabled can still be dragged above it and that would change the order of the list; the feature I am looking for would FIX that item's index so its order cannot be changed.
For example I have a list that contains 5 items and I want the first item to always remain on top, so I will FIX that item and make it disabled, so now all other items below it can be dragged and moved around but that FIXED item will always remain at index 1/0. Same could be done for the last item as well.
The text was updated successfully, but these errors were encountered: