Autocomplete options - what is the value property for?
A related question was asked here: https://discord.com/channels/222078108977594368/1035366885891506278
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?6 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
hmm i think i see
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
but so if I had an option with name "hello", and the user manually types the word "hello", would the bot still receive the
value
field?
if the user didn't click the autocomplete choice?Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
oh ok
too bad then
thanks for the help though