Skip to content
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

The value prop does nothing #235

Closed
ThomasHickman opened this issue Jan 17, 2024 · 2 comments · Fixed by #244
Closed

The value prop does nothing #235

ThomasHickman opened this issue Jan 17, 2024 · 2 comments · Fixed by #244
Assignees
Labels
bug Something isn't working

Comments

@ThomasHickman
Copy link

ThomasHickman commented Jan 17, 2024

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:
image
and the values property is only used in types.ts:
image

Indicating that the AutoComplete value property does nothing.

However, from looking around the codebase, it looks like if you pass in value to AutoCompleteInput, this will make sure you can use AutoComplete 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

@Kysluss
Copy link
Collaborator

Kysluss commented Feb 7, 2024

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.

@Kysluss Kysluss self-assigned this Feb 7, 2024
@Kysluss Kysluss added the bug Something isn't working label Feb 7, 2024
@Kysluss
Copy link
Collaborator

Kysluss commented Feb 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants