Skip to content

[Bug:] Autocomplete component requires multiple return presses when implemented as part of a form #3864

Description

@brdunfield

Describe the Bug

Raising a bug ticket after a slack discussion with John Ryan. Link to slack discussion for more context: https://cmsgov.slack.com/archives/CHH0381RD/p1766080205361559

See steps to reproduce. John suggested that this might have something to do with the event not bubbling correctly up to the form.

To reproduce

  1. Visit https://openpaymentsdata.cms.gov/
  2. In the search field on the home page, type 'smith'
  3. do NOT use arrow keys or mouse to select any dropdown entries that appear
  4. Press enter - the dropdown closes but the form does not submit
  5. Note that you must press enter again to get the form to submit
  6. Selecting an entry from the dropdown and pressing enter once works as expected and you are directed to that entry's page

Expected behavior

First enter press should bubble up and allow for form submit when no entry is selected

Severity/Impact

Low: Nice to have/UX improvement suggestion

Desktop Operating System

Mac

Desktop Browser Name

Chrome

Desktop Browser Version

No response

Device

No response

Mobile Operating System

No response

Mobile Browser Name

No response

Mobile Browser Version

No response

Additional context

No response

Codebase/Repository URL

https://github.cms.gov/open-data/payments/blob/develop/src/frontend/src/components/EntitySearchForms/Hero/TruncatedSearch.tsx#L143

Design System Version

12.0.0

Existing branch or Pull request on Github

No response

Team Name

WeCMS Open Data / Open Payments

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impacts: CoreImpacts the core DS primarily, changes may occur in other themes as well.Impacts: DocumentationIndicates that this item relates to documentationImpacts: HealthcareImpacts the Healthcare.gov theme directly.Impacts: MedicareImpacts the Medicare theme directly.Status: In JIRAIndicates that this item is also tracked in JiraStatus: Work In ProgressPR's that are not yet ready for reviewdependenciesPull requests that update a dependency filejavascriptPull requests that update javascript code

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions