-
Notifications
You must be signed in to change notification settings - Fork 145
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
Value restrictions and data validation #16
Comments
Sounds strange.. I'm not getting the same behavior.. whenever I leave the field it resets the value unless an exact match has been typed out in full (or if I selected an option of course). Two questions:
|
I was using Firefox 7 on a Mac. There was no blank select. It was like I
|
I haven't looked at the source so I'm just speculating, but perhaps adding or adjusting the event handler for the Don't know if this is helpful at all, but it was an idea I had. |
Seems like a plausible solution. If there's a blank option I think it should always revert to that unless the full name has been typed. But in case there's only value options, then it should handle this case intelligently by somehow selecting the most relevant match. |
I find that usually blank options are place holders. They're there so the user doesn't think a value has been filled for them. But who knows, there could be use case for either way. Maybe an option on instantiation of the selectToAutocomplete object to set that preference would be good? I know in my case I would rather the nearest match be filled instead of a blank option. |
I think that when an invalid string has been typed and the field blurs, it should just revert back to whatever the last valid response was. This allows the user to start typing and then 'cancel' their action. |
I think that makes sense when the string is completely invalid. If the string is a partial match to something then I think the nearest match should be filled. |
I'm personally in favor of @dontangg's approach. @hradac my worry is that we make an active choice for the user based on what is essentially a guess. In the approach presented by @dontangg we simply revert back to the user's previous choice. However, there's a "handle_invalid_input" function, so you can overwrite the default behavior if you want to do something else. |
Using a select drop down limits the user to certain set of acceptable answers. While I really like selectToAutocomplete I find that I miss that aspect of select boxes. If I type a single letter and submit the form the very first option in the list is submitted even if that option did not match the single letter I typed. Is there a way to ensure the user selects one of the options available, or at least that the first option in the subset of options gets submitted?
For example, my options start with "United States" yet when I type and submit "f" it is "United States" that is submitted, not "France".
To clarify the flow goes like this: I type "f" then click off the field where it stays "f". I know that if I type "f" and hit "enter" that "France" auto fill the field. So I guess the question is, is there a way to get "France" to auto fill if the user simply clicks off the field while typing?
The text was updated successfully, but these errors were encountered: