-
-
Notifications
You must be signed in to change notification settings - Fork 53
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] Refactor useAutocomplete to use Base UI building blocks #45
Comments
Since |
I don't think components other than Autocomplete would make use of infinite scroll, so we need to be careful not to include features that won't be used but will increase the component size. I think we can add an event to the List fired when scroll is near the bottom. |
@michaldudak Infinite scrolling inside a list is in fact a very common feature rather than not, I have it implemented on my own by using the Intersection Observer. So it make sense to also add it to the List as you mentioned. |
I've opened an issue to organize the scope of Autocomplete for material-next: mui/material-ui#39963 I think at a minimum we can convert to TS |
@michaldudak Hey, I would like to work on the useAutocomplete hook and convert it to typescript, if that would be ok? |
There's no point in doing this now. We plan to create the new Autocomplete/Combobox component in Base UI and use it in Material UI. |
Superseded by #222 |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. |
The
useAutocomplete
hook was created before Base UI existed and has code patterns different from the rest of the hooks in the library. Additionally, it does not use the lower-level building blocks from Base UI (likeuseList
) but implements its whole functionality by itself. Reusing the same building blocks as other components could help us reduce the overall bundle size and have feature parity with the Select (where applicable).There are a number of issues reported that could be solved by replacing the implementation.
Areas of improvement:
useList
instead of reimplementing keyboard navigationget*Props
functionsfreeSolo
)Issues that could be solved along the way:
getOptionLabel
callback is getting the value instead of option object material-ui#31192onScrollToBottom
prop material-ui#35653Since this will likely be a breaking change, we should leave the current version intact (but deprecate it and remove it in the future).
The text was updated successfully, but these errors were encountered: