Entity browser modal dialog opens by pressing enter in any text field

Created on 27 July 2017, about 8 years ago
Updated 28 July 2025, about 2 months ago

Problem/Motivation

Steps to reproduce:

  1. Enable entity browser example
  2. Go to node/add/entity_browser_test
  3. Enter sample text in "Title" field and press ⏎
  4. Entity browser modal window gets opened

The bug seems to appear in entity_browser.view.js.

Proposed resolution

React on ⏎ events occured in entity browser's exposed view filters fields only.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Field widget

Created by

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • πŸ‡¦πŸ‡ΊAustralia jannakha Brisbane!

    Tested on D10.5:

    - Without patch entity browser window is opened by pressing Enter on any text field
    - MR2 installed, tested, fixes the issue

    Please release?

  • πŸ‡³πŸ‡±Netherlands seanB Netherlands

    Now we have πŸ› There is no way to make a button element that can use the AJAX functionality Needs review in core, we could use this to actually create a button type="button" instead of using JS to change the button type.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Back to NW as of #32 - maybe someone could start a fresh MR based on that?

  • First commit to issue fork.
  • @cboyden opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States cboyden

    @anybody it sounded like you wanted a new branch and MR for this issue, so I created one that renders a generic button instead of a submit button. If this should go into the existing MR I can make that change.

    For future reference, in addition to setting the #type property to button, you have to add a '#submit_button' property and set it to FALSE.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @cboyden thanks! Does it work? As next step we'd indeed need test coverage for the related parts.

Production build 0.71.5 2024