-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[Autocomplete] Virtualized with grouped items #18597
Comments
@Janpot It seems that we miss the following style in the component: diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js
index cbf86bdc5..d03350159 100644
--- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js
+++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js
@@ -135,6 +135,7 @@ export const styles = theme => ({
/* Styles applied to the option elements. */
option: {
minHeight: 48,
+ boxSizing: 'border-box',
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center', Given that the virtualization is an advanced demo, I think that we might as well showcase the grouped version: https://codesandbox.io/s/virtualized-grouped-attempt-wm0hi. |
I agree. Shouldn't that flat implementation of |
@Janpot Better semantic & accessibility? |
I don't really care about this much personally, but one thing that seems to not work with your demo is the floating subheaders. |
@Janpot We have seen many of our users that don't care about accessibility (the majority actually). However, we have a good position to improve it, I think that we should take it. Sticky position support is a "won't fix" from my perspective (not worth the hassle): |
Oh no, I care about accessibility, I was talking about the floating subheaders. Hence I agree, not worth the hassle. |
@Janpot Great 👍 |
@Janpot Do you want to work on these changes? |
Not in the foreseeable future. but I'm gonna need it at some point so if nobody has picked it up by then, I will. |
Summary 💡
I'm trying to add grouping to the virtualized autocomplete example. But it seems like the List that is virtualized is comprised of one child per group instead of one child per option. Would it be possible to implement the grouped autocomplete as a flat list of items+subheaders instead.
I've kind of started looking into it with
renderGroup
but it's not working well yet. a pair of extra eyes would be helpful as well. It seems to me this should be possible to support out of the box.Examples 🌈
https://material-ui.com/components/autocomplete/#virtualization
https://material-ui.com/components/autocomplete/#grouped
The text was updated successfully, but these errors were encountered: