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] Cannot reorder elements to the bottom of the tree view if the last item has children #16171

Open
ascagnelli-withluminary opened this issue Jan 14, 2025 · 3 comments · May be fixed by #16384
Assignees
Labels
bug 🐛 Something doesn't work component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!

Comments

@ascagnelli-withluminary
Copy link

ascagnelli-withluminary commented Jan 14, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: https://mui.com/x/react-tree-view/rich-tree-view/ordering/
  2. In the top "Enable drag-and-drop reordering" example, attempt to drag any element below the last element in the tree

Current behavior

In the example, the final item in the list is highlighted and the item is dropped within.

Expected behavior

A line should be displayed under the final item in the list, and on drop the dragged item should appear at the top-level of the tree.

Context

I'm trying to display items that can be reordered within a tree view, but they can't be reordered freely.

Your environment

I was able to replicate this in the sample/demo environment, but here's my local configuration:

  System:
    OS: macOS 15.2
  Binaries:
    Node: 18.8.0 - ~/.config/nvm/versions/node/v18.8.0/bin/node
    Yarn: Not Found
    npm: 8.18.0 - ~/.config/nvm/versions/node/v18.8.0/bin/npm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Safari: 18.2
  npmPackages:
    @emotion/react: ^11.10.5 => 11.11.1
    @emotion/styled: ^11.9.3 => 11.11.0
    @mui/base:  5.0.0-beta.67
    @mui/core-downloads-tracker:  6.2.1
    @mui/lab: ^6.0.0-beta.20 => 6.0.0-beta.20
    @mui/material: ^6.2.1 => 6.2.1
    @mui/private-theming:  6.2.1
    @mui/styled-engine:  6.2.1
    @mui/system:  6.2.1
    @mui/types:  7.2.20
    @mui/utils:  5.15.7
    @mui/x-charts: ^6.19.3 => 6.19.3
    @mui/x-data-grid:  6.15.0
    @mui/x-data-grid-pro: ^6.9.1 => 6.15.0
    @mui/x-date-pickers: ^5.0.15 => 5.0.20
    @mui/x-internals:  7.23.0
    @mui/x-license:  7.23.2
    @mui/x-license-pro: ^6.0.4 => 6.10.2
    @mui/x-tree-view:  7.23.2
    @mui/x-tree-view-pro: ^7.23.2 => 7.23.2
    @types/react: 18.0.33 => 18.0.33
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.3.1 => 18.3.1
    typescript: ^5.2.2 => 5.2.2

Search keywords: tree view, reordering, bottom

Order ID: 87493

@ascagnelli-withluminary ascagnelli-withluminary added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 14, 2025
@github-actions github-actions bot added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Jan 14, 2025
@ascagnelli-withluminary ascagnelli-withluminary changed the title Cannot reorder elements to the bottom of the tree view if the last item has children [treeview] Cannot reorder elements to the bottom of the tree view if the last item has children Jan 14, 2025
@michelengelen
Copy link
Member

Hey @ascagnelli-withluminary and thanks for reporting this. I can confirm that it is nor possible to reorder in the described way. It makes no difference if the parent is open or closed and how many levels the descendants themselves have.

I'll add it to the board! 👍🏼

@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 15, 2025
@jyash97
Copy link

jyash97 commented Jan 20, 2025

@michelengelen is this something I can pick up? Would love to try to solve this

@michelengelen
Copy link
Member

@michelengelen is this something I can pick up? Would love to try to solve this

Definitely. I'll assign this to you! 👍🏼

@jyash97 jyash97 linked a pull request Jan 29, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants