Autocomplete options - what is the value property for?
A related question was asked here: djs-questionsAppend autocomplete result to user input instead of replacing
I'm trying to do the same thing as them (show just one word as an autocomplete option, but when they select the option, it only appends it to the end of their current input), but I have a more specific question. Autocomplete options take an object with required properties
What I assumed at first was that the
After experimenting, I found that the
and
So what is the point of the value field? Or is this a bug?
I'm trying to do the same thing as them (show just one word as an autocomplete option, but when they select the option, it only appends it to the end of their current input), but I have a more specific question. Autocomplete options take an object with required properties
name and value, but usually people set them to the same thing, so they don't care about the differences between the properties. Like this:What I assumed at first was that the
name property is displayed to the user, but when they click the option, the value property would replace their input. But that didn't work.After experimenting, I found that the
value property actually has no effect whatsoever on the autocomplete interaction. These next two examples have the exact same results - the user sees the name property ("hello") when viewing the autocomplete options, and when clicking it, their input is completely replaced by the name property ("hello").and
So what is the point of the value field? Or is this a bug?