-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[base] Maintain nodes document order in compound components #36857
[base] Maintain nodes document order in compound components #36857
Conversation
Netlify deploy previewhttps://deploy-preview-36857--material-ui.netlify.app/ @material-ui/unstyled: parsed: +0.39% , gzip: +0.45% Bundle size report |
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.
@michaldudak i could still reproduce the issue though.
- enter "d"
- clear "d"
- press "Tab"
here i think 1st option should be highlighted but right now 2nd option is highlighted
Ahh, OK, it's a different issue now (that's actually a feature in other cases). What happens is that the Menu tries to keep the highlighted item when options change. This is handy when you load more options lazily and don't want the scroll to reset (we recently had this issue in Material UI's Autocomplete). Let me think for a bit about how to approach this to handle both cases. I suppose the lazy loading case won't be common for menus, so we can always reset the highlight. On the other hand, I didn't expect to see a Menu with filtering functionality... |
…d-components-order
@siriwatknp This should fix the problem with Base UI's marketing page's Select highlighting the middle item. |
…d-components-order
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.
Looks good 👍
Makes sure that the registered compound component's children are in document order, even if inserted in the middle of the existing collection.
Part of the fix for #36800
Before: https://codesandbox.io/s/modest-gates-zwyhbd?file=/demo.tsx
After: https://codesandbox.io/s/naughty-banzai-3d6e6z?file=/demo.tsx