Incompatibility with autocomplete entity reference fields

Created on 1 October 2024, 4 months ago

Problem/Motivation

When the edit form has an entity reference field such as a taxonomy field there are issues when trying to add a item to the field.

Steps to reproduce

composer create drupal/recommended-project:^10
composer require drush/drush
composer require drupal/same_page_preview
drush -y site:install demo_umami --account-name=admin --account-pass=admin
drush -y en same_page_preview

Visit: e.g.: node/6/edit
Add a taxonomy tag e.g. baked

Pop-up appears that has confusing messaging about leaving the preview.
"Leave preview?
Leaving the preview will cause unsaved changes to be lost. Are you sure you want to leave the preview?
CTRL+Left click will prevent this dialog from showing and proceed to the clicked link."

Clicking "Leave preview" resets the field. Clicking cancel adds the taxonomy terms as expected.

Proposed resolution

Determine a way to allow the page to refresh when adding a taxonomy term

Remaining tasks

User interface changes

πŸ› Bug report
Status

Active

Version

2.1

Component

User interface

Created by

πŸ‡¬πŸ‡§United Kingdom the_g_bomb

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

Comments & Activities

  • Issue created by @the_g_bomb
  • πŸ‡¬πŸ‡§United Kingdom the_g_bomb
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    I put together a demo video to show that I'm not seeing this issue. (Drupal 11, PHP 8.3). Maybe just writing a response here would be sufficient.

    The preview updates when you make a change in a field and then change the focus of the field to something else. This allows you to make a lot of edits in a field like an autocomplete field and then only get the preview to update when you are done. I think we may be confusing users by having the title field live update, because that's the only field that does live update.

    Every other field only updates when you change your focus to another field or anything else. Like make your change to the autocomplete then tab away.

    For the Umami demo profile, the autocomplete field is the last field of the article content type. Maybe that is why it's easier to see the issue with this autocomplete field, because what are you going to tab to?

    Until we have a reason to fully adopt a live-preview strategy for all fields, I'm marking this issue as works as designed.

  • πŸ‡¬πŸ‡§United Kingdom the_g_bomb

    I was going to add this module as a part of the Drupal CMS Accessibility Tools Track, but the same issue affects the demo site.
    The Umami demo profile was used to highlight the issue here as I tested the functionality there to ensure it was just the Drupal CMS suite of tools causing the issue.

    Unfortunately the entity reference field is higher in the node form in the Demo which causes the issue to surface sooner in the edit process.

  • πŸ‡¬πŸ‡§United Kingdom the_g_bomb

    I just retested with the latest Drupal CMS demo and it seems to have been sorted. As you say perhaps the upgrade to D10.5 or 11 has solved things. Leaving as "Closed (works as designed)". Thank you

Production build 0.71.5 2024