I think Patch #21 already delivers on that change.
autocomplete.splitValues
defined here:
https://git.drupalcode.org/project/drupal/-/blob/1efbc4ec5b4ccd770e51e77...
Fires autocompleteSplitValues
from here:
https://git.drupalcode.org/project/drupal/-/blob/1efbc4ec5b4ccd770e51e77...
Which has the change:
if (autocomplete.options.isSingle) {
return value ? [value] : [];
}
Facing this exact issue, very glad to see some work has been done on this already, thanks @alecsmrekar
In my instance my Autocomplete field is replacing only the part of the string *after* the last comma. For example:
1. Searching for "phrase with, commas".
2. Select one of the autocomplete results, e.g. "Longer phrase with, commas"
3. The field value is then set to "phrase with, Longer phrase with, commas".
Patch in #21 is working for me. After applying the patch and adding the `data-autocomplete-single` attribute to my field the full value is replaced:
1. Searching for "phrase with, commas".
2. Select one of the autocomplete results, e.g. "Longer phrase with, commas"
3. The field value is then set to "Longer phrase with, commas".