Unexpected behavior when pasting text into autocomplete form field

Created on 28 May 2025, 9 days ago

Problem/Motivation

When using the entity reference autocomplete form widget, it is not possible to paste text in most cases. I suppose it is only possible when the pasted text exactly matches one item, and/or when autocreation of entities is enabled.

Steps to reproduce

1. Add an entity reference field to a content entity.
2. Use the Tagify field widget for the form field.
3. Navigate to the form and paste some random text into the form field.
4. Tagify tries to resolve the tag directly.
5. The autocomplete selection plugin rejects the tag.
6. The tag is removed.

Proposed resolution

I would expect that one can paste text, and then the autocomplete selection plugin queries for matching entities, allowing one to select the desired entity from the dropdown.

Use the pasteAsTags: false setting for Tagify and listen for paste/cut events.

Remaining tasks

Discuss the intended behaviour. See the attached merge request for the first suggestion.

User interface changes

The paste behaviour will change for the Tagify form widget.

📌 Task
Status

Active

Version

1.2

Component

Code

Created by

🇩🇪Germany simonbaese Berlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024