You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the docs, the prop value in the AutoComplete component says that this prop is:
value of the component in the controlled state
However, from testing this out and looking in the source code, it looks like the value property is only used in example code, or types.ts, or the values property:
and the values property is only used in types.ts:
Indicating that the AutoCompletevalue property does nothing.
Hi @ThomasHickman . Sorry for the delay on getting back to you.
You're definitely right and this is probably one of the biggest causes for confusion with the component. I'm thinking I should try and make the value prop actually do what it's supposed to. It will take some testing to make sure I don't inadvertently introduce a separate bug. I should have some time this weekend to work on it and appreciate any input you have on it.
v5.3.0 has been released and fixes this issue. I will be updating the docs and demo soon to show how you would implement form libraries like react-hook-form and formik.
In the docs, the prop
value
in theAutoComplete
component says that this prop is:However, from testing this out and looking in the source code, it looks like the
value
property is only used in example code, ortypes.ts
, or thevalues
property:and the
values
property is only used intypes.ts
:Indicating that the
AutoComplete
value
property does nothing.However, from looking around the codebase, it looks like if you pass in
value
toAutoCompleteInput
, this will make sure you can useAutoComplete
as a controlled component see:https://github.com/anubra266/choc-autocomplete/blob/main/src/autocomplete-input.tsx#L62-L68
If this is true, it would be great if the documentation was updated to reflect this
The text was updated successfully, but these errors were encountered: