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

[TreeView]: allow reordering item to bottom #16384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jyash97
Copy link

@jyash97 jyash97 commented Jan 29, 2025

Closes #16171

Currently, we weren't allowing the items to be reordered to the bottom of the list, I added a condition to reorder-below in case we reach the end of the list. Attaching a video in order to show the working of the current fix.

Mui-X.reordering.mov

},
// For the last element allow reordering to the bottom
'reorder-below':
!targetItemMeta.expandable || targetItemIndex + 1 === totalItems
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I am looking into the diff, I feel the condition should be only applicable when parentId is null

@zannager zannager added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Jan 30, 2025
@flaviendelangle flaviendelangle self-requested a review January 31, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[treeview] Cannot reorder elements to the bottom of the tree view if the last item has children
2 participants