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

Comments

rhovland created an issue. See original summary.

rhovland’s picture

Issue summary: View changes
rhovland’s picture

rhovland’s picture

Issue summary: View changes
rhovland’s picture

Added 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

jmagunia’s picture

Status: Active » Needs review

I guess this needs review now. Marking it as such.

socialnicheguru’s picture

socialnicheguru’s picture

  • granik committed 2ac3450 on 1.0.x
    Issue #3226560: make autocomplete work with commas
    
granik’s picture

Status: Needs review » Fixed

Commited your patch. Thanks!

klonos’s picture

Thank you @granik 🙏

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.