-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] regression in behavior for freeSolo Autocomplete with custom Popper/Paper and no options #44048
Comments
i'm not sure what the best solution is, currently we are applying a patch to our internal application to go back to the old behavior i'm not sure whether this re-introduces #40843 or not since we never experienced that bug to begin with |
Is there any chance this will be officially fixed or patched? Currently it is stopping us from updating MUI unless we put in a workaround ourselves. |
I have reverted for v5 in #44857. It should be available in the next version 5 release. I'll close this issue. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @snapwich How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Old behavior: https://stackblitz.com/edit/react-ouzbqw-wbhjow?file=Demo.tsx,package.json
New behavior: https://stackblitz.com/edit/react-ouzbqw-vpfhhc?file=Demo.tsx,package.json'
Steps:
[]
SET DEFAULT OPTIONS
to reset and try againCurrent behavior
When options prop is set to
[]
the Autocomplete Popper is no longer rendered. The Autocomplete's state still considers itself open and the onClose handler is not called. Any custom Popper/Paper used in the Autocomplete will not be rendered.Expected behavior
The Autocomplete stays open if you have a custom Popper/Paper so that you can display other information or maybe even a custom "No Items" option.
Context
In our case we have a custom Autocomplete used as a global site search that renders a custom Popper/Paper that includes chips that link to certain "Advanced search" options as well as contains a recently searched section (the Autocomplete's options) that will show recent results. In our current version of MUI v5.10.17 when there are no recent search options the Autocomplete can still be expanded and the Chips used to navigate to advanced search pages.
However, updating to the latest 5.x version of MUI v5.16.7 (bug also present in latest 6.x version) when there are no recent search options and the Autocomplete's options prop is
[]
it will not open, or it will close the Autocomplete if the user has expanded it and options is asynchronously loaded and results in an empty data result. Also when the Autocomplete closes asynchronously because ofoptions=[]
it will not call onClose or update its internalopen
state unless the user does an action that makes it realize it is no longer open (such as clicking somewhere and causing a blur event).This regression was introduced in #41300
Your environment
npx @mui/envinfo
Search keywords: autocomplete freesolo no options custom popper paper
The text was updated successfully, but these errors were encountered: