Skip to content

Conversation

@flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Nov 18, 2025

Part of #20301
Fixes #20130

  • Cancel the drag sequence when droping an item on itself
  • Use the contentRef to determine the current coordinate of the mouse within the target item
  • Allow to drop an item onto a non-reorderable item

@flaviendelangle flaviendelangle self-assigned this Nov 18, 2025
@flaviendelangle flaviendelangle added type: bug It doesn't behave as expected. plan: Pro Impact at least one Pro user. scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. labels Nov 18, 2025
@mui-bot
Copy link

mui-bot commented Nov 18, 2025

Deploy preview: https://deploy-preview-20368--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro ▼-190B(-0.22%) ▼-61B(-0.22%)

Details of bundle changes

Generated by 🚫 dangerJS against 508a1c8

@flaviendelangle flaviendelangle marked this pull request as ready for review November 18, 2025 09:13
@flaviendelangle flaviendelangle changed the title [tree view] Dropping an item on itself should cancel the drag sequence [tree view] Fix unwanted behaviors on the item re-ordering Nov 18, 2025
Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

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

LGTM 👌 🎉 Also seems to fix part of #20130 from the same community member

@flaviendelangle
Copy link
Member Author

flaviendelangle commented Nov 18, 2025

I can try to fix the other half of #20130 if it's a small fix 👀
EDIT: Done

params,
store,
}) => {
const canItemBeDragged = React.useCallback(
Copy link
Member Author

Choose a reason for hiding this comment

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

Was never used

@flaviendelangle flaviendelangle merged commit 4fecd27 into mui:master Nov 18, 2025
20 checks passed
@flaviendelangle flaviendelangle deleted the drop-item-on-itself branch November 18, 2025 16:26
bernardobelchior added a commit to bernardobelchior/mui-x that referenced this pull request Nov 19, 2025
mapache-salvaje pushed a commit to mapache-salvaje/mui-x that referenced this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan: Pro Impact at least one Pro user. scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tree view] Ordering Drag&Drop Behaviour

3 participants