Skip to content

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Aug 27, 2025

Part of #9685

The flat DOM structure would be forced when using the virtualization.
Not sure if people should be able to enable it without virtualization, I think we can wait for users feedback before adding this option.

@flaviendelangle flaviendelangle self-assigned this Aug 27, 2025
@flaviendelangle flaviendelangle added type: new feature Expand the scope of the product to solve a new problem. scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. labels Aug 27, 2025
@mui-bot
Copy link

mui-bot commented Aug 27, 2025

Deploy preview: https://deploy-preview-19350--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-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 🔺+442B(+0.71%) 🔺+181B(+0.95%)
@mui/x-tree-view-pro 🔺+442B(+0.52%) 🔺+170B(+0.64%)

Details of bundle changes

Generated by 🚫 dangerJS against 38fc751


describe('onClick prop', () => {
it('should call onClick when clicked, but not when children are clicked for TreeItem', () => {
it('should call onClick when clicked, and when children are clicked for TreeItem (when using nested DOM structure)', () => {
Copy link
Member Author

@flaviendelangle flaviendelangle Aug 27, 2025

Choose a reason for hiding this comment

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

The test was outdated since #12839
It's the only test that is impacted by the new DOM structure.
When the flat DOM structure is enabled automatically by the virtualization, I'll run this test with and without the virtualization and assert the right values 👍

I'm not sure this test testes anything relevant anymore... it jut checks that onClick is forwarded to the DOM element, like any other prop.

}),
loading: false,
error: null,
domStructure: 'nested',
Copy link
Member Author

@flaviendelangle flaviendelangle Aug 27, 2025

Choose a reason for hiding this comment

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

You can try the new DOM structure by setting 'flat' here.
All the tests should pass except one (see the other comment).

Copy link

github-actions bot commented Sep 2, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 2, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 2, 2025
@flaviendelangle flaviendelangle marked this pull request as ready for review September 9, 2025 07:27
…n/useTreeViewExpansion.selectors.ts

Co-authored-by: Rita <[email protected]>
Signed-off-by: Flavien DELANGLE <[email protected]>
Copy link
Member

@rita-codes rita-codes left a comment

Choose a reason for hiding this comment

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

Great work on this! :shipit:
I left a couple of questions, but overall it looks good to me 👏

@flaviendelangle flaviendelangle merged commit 480d03f into mui:master Sep 15, 2025
21 checks passed
@flaviendelangle flaviendelangle deleted the flat-list branch September 15, 2025 10:50
@flaviendelangle flaviendelangle changed the title [TreeView] Support flat DOM structure [TreeView] Support flat DOM structure (not publicly exposed) Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants