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

Click does not set input value #25

Closed
master-elodin opened this issue Jun 29, 2018 · 6 comments · Fixed by #52
Closed

Click does not set input value #25

master-elodin opened this issue Jun 29, 2018 · 6 comments · Fixed by #52

Comments

@master-elodin
Copy link
Contributor

If an option gets clicked, input.value does not get set as one would expect.

@PatrickDesign
Copy link
Collaborator

Is this feature still desired?

@master-elodin
Copy link
Contributor Author

Yeah, it's still desired. I've had a PR open for it for the last two years :)
#25

@ritz078
Copy link
Owner

ritz078 commented Oct 5, 2020

Sorry I didn't address this earlier. I think that in theory this component should always be controlled.

Why ?

  • The user can decide what value to fill in the input field based on the selected result. It might not always be a fixed property. To fix this we will have to provide an additional prop that we should avoid.
  • It's a good principle that form elements are controlled so that a single data source handles the value. This makes prefilling the data in the input field easier.

Having said that, I think we should fix #27 so that it always behaves a sa controlled component. What does everyone think ?

Again I am sorry for jumping in late on this one.

@PatrickDesign
Copy link
Collaborator

PatrickDesign commented Oct 6, 2020

The user can decide what value to fill in the input field based on the selected result.

We do not currently allow the input value to be set by the user, do we?

@ritz078
Copy link
Owner

ritz078 commented Oct 6, 2020

We do not currently allow the input value to be set by the user, do we?

You are right. We don't do that. So we should add a prop that can directly take the value that needs to be shown from the user instead of handling it ourselves.

@PatrickDesign
Copy link
Collaborator

@ritz078 The fix for this issue has been moved to a simpler approach in #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants