[Autocomplete] filterSelectedOptions
with multiple
doesn't work when state is controlled via react-hook-form
#45489
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Steps to reproduce
Steps:
Current behavior
When using the
Autocomplete
component with multiple values while controlling the state using react-hook-form you canfilterSelectedOptions
prop is providedExpected behavior
filterSelectedOptions
should correctly filter out already selected optionsManaged to workaround issue (1) by using the
reason
anddetails
parameters fromonChange
here: https://codesandbox.io/p/devbox/xenodochial-fermat-wllkh3?from-embed=&workspaceId=ws_8Gvn86jdwuzyvAQSp15K4uContext
I'm using react-hook-form to manage form state, with part of my form being a multi-select from a list of ~300 options.
I thought using
multiple
withAutocomplete
would be perfect for this to allow the user to search among all the options easily, but it doesn't quite work exactly the way I want it to when also using react-hook-form to manage the state of the entire form.Your environment
Tested in Chrome, but observed in Safari, and Firefox as well via Code Sandbox
npx @mui/envinfo
Search keywords: react-hook-form autocomplete multiple filterSelectedOptions
The text was updated successfully, but these errors were encountered: