-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[TreeView] Support flat DOM structure (not publicly exposed) #19350
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
Conversation
Deploy preview: https://deploy-preview-19350--material-ui-x.netlify.app/ Bundle size report
|
e30186b
to
82fe7d7
Compare
|
||
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)', () => { |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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).
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
...ges/x-tree-view/src/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.selectors.ts
Outdated
Show resolved
Hide resolved
…n/useTreeViewExpansion.selectors.ts Co-authored-by: Rita <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
There was a problem hiding this 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!
I left a couple of questions, but overall it looks good to me 👏
Signed-off-by: Flavien DELANGLE <[email protected]>
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.