This works until I remove option clear-on-focus?. I seems that here the on-focus event gets fired when a candidate is selected also. [UPDATE: this only happens when clicking on a candidate, using keyboard it works alright]
So 2 questions:
is that the correct way to use typeahead to be able to have value -> label functionality?
what to do to clear the input on focussing but not when a selection is made?
Yeah that looks like an omission as keyboard/clicking should work consistently. The typeahead looks correct, but I think the widget needs to be updated to handle the clearing case.
Hi this https://github.com/reagent-project/reagent-forms/pull/63 has introduced possibility to specify a "label" for a value for the typeahead input. I had a hard time to crack it. Better docs on this could help :)
The field is an
id
of a person, but I want to display and search byfull-name
of the person. What I think has to be done:[full-name id]
id
and finds the correctfull-name
to put into input's valueid
that has to be storedfull-name
in my case)Roughly I do:
This works until I remove option
clear-on-focus?
. I seems that here the on-focus event gets fired when a candidate is selected also. [UPDATE: this only happens when clicking on a candidate, using keyboard it works alright]So 2 questions: