The typeahead in the ngds-forms package uses string matching when selecting typeahead options. It picks the first option with a string match with what you selected, but it used to work on a word by word basis. If you selected Goldstream Corridor, the string matcher would look for Goldstream and Corridor individually, which lead to the incorrect subarea Goldstream getting selected first.
The typeahead in the form engine has been updated to require a 100% string match now, so Goldstream Corridor must match 'Goldstream Corridor' in its entirety.
It would be bad practice for a typeahead to have two options that share the exact same display string (eg two options that both say Goldstream Corridor but refer to different subareas). A console warning has been added to the form engine to alert developers when they are designing such a typeahead.
Fixes #325
The typeahead in the ngds-forms package uses string matching when selecting typeahead options. It picks the first option with a string match with what you selected, but it used to work on a word by word basis. If you selected
Goldstream Corridor
, the string matcher would look forGoldstream
andCorridor
individually, which lead to the incorrect subareaGoldstream
getting selected first.The typeahead in the form engine has been updated to require a 100% string match now, so
Goldstream Corridor
must match 'Goldstream Corridor' in its entirety.It would be bad practice for a typeahead to have two options that share the exact same display string (eg two options that both say
Goldstream Corridor
but refer to different subareas). A console warning has been added to the form engine to alert developers when they are designing such a typeahead.