bcgov / bcparks-ar-admin

BCParks Attendance and Revenue Admin
Apache License 2.0
4 stars 11 forks source link

BRS-325 updating form engine package to fix typeahead issue #326

Closed cameronpettit closed 3 months ago

cameronpettit commented 3 months ago

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 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.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud