Problem/Motivation
When a user enters a comma into the autocomplete field it breaks the expected behavior which is to ignore the comma and search for the full text entered. So something like "123 Fake St, Springfield" is broken into two separate search terms by the autocomplete field and the user ends up only seeing results for "Springfield".
This behavior was attempted to be corrected in core and was rejected as "works as designed"
#2864549: Commas in autocomplete textfield give incorrect behaviour
The official "fix" is to enclose the search term in quotation marks. This is not feasible for something user facing.
Proposed resolution
Override the default behavior of the autocomplete field so that addresses entered with commas work as expected.
OR
Fix the behavior in core #2864844: Autocomplete used on a single value field should not split input on commas
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | commas-in-an-address-breaks-autocomplete-3226560-5.patch | 1.11 KB | rhovland |
Comments
Comment #2
rhovlandComment #3
rhovlandComment #4
rhovlandComment #5
rhovlandAdded a javascript override that only applies to the address_autocomplete autocomplete widget
It changes the default behavior and now no longer treats commas as a delimiter
Comment #6
jmaguniaI guess this needs review now. Marking it as such.
Comment #7
socialnicheguru commentedThis worked and I needed Google Maps integration incorrectly prepopulates address fields
Comment #8
socialnicheguru commentedComment #10
granikCommited your patch. Thanks!
Comment #11
klonosThank you @granik 🙏