-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[RichTreeViewPro] Add virtualization #13520
base: master
Are you sure you want to change the base?
[RichTreeViewPro] Add virtualization #13520
Conversation
Deploy preview: https://deploy-preview-13520--material-ui-x.netlify.app/ Updated pages: |
5b44ae1
to
1120a40
Compare
1120a40
to
b80bc1a
Compare
bb3e433
to
ead30ca
Compare
I spent some time looking at the PR and I see what you meant now. 😆 I don't know if it is possible to do full virtualization on a nested DOM arch. And if possible it would still be much more complex than just having flat DOM... 🙃 With that said. If we can assume all items have the same height, and we know the list of items beforehand, however nested it is, we can try to flatten the const items = [
{
id: '1',
children: [{ id: 'a' }, { id: 'b', children: [{ id: 'I' }] }],
},
{
id: '2',
children: [{ id: 'a', children: [{ id: 'I' }, { id: 'II' }] }, { id: 'b' }],
},
];
// Maybe use the array index if we don't have ids? (e.g. `'0.0.0, '0.1.0'`)?
const flatIds = ['1', '1.a', '1.b', '1.b.I', '2', '2.a', '2.a.I', '2.a.II', '2.b']; We could then have a custom render that knows this context, so if say, we are inside | 2. |
|| a. ||
||| ...n-m ||| <- "fake" scroll happens in `a.` content
---visible----
||| ...n |||
---visible----
||| ...n+m ||| Though I'm not sure it would work, and orchestrating all these containers might be a real pain, because we will have |
@JCQuintas I think we have the same idea 👌
At some point I have to work on a flat list yes, even if the final DOM structure end up being nested. But then the main challenge is to orchestrate all those offsets correctly 😬 , hopefully it's doable without to much headache... Keeping the |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
e7d40dd
to
c7d6da7
Compare
Performance-wise, it looks like trying to virtualize with a I'll explore a bit to see if we can correctly support |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Closes #9685
Extracted PRs
Benchmarks
TODO
Very incomplete list