Skip to content

[autocomplete] Escape key blurs input before closing popup #4240

@mirka

Description

@mirka

Current behavior

When the filtered list is empty (e.g. typing "asdf") and the popup is showing Autocomplete.Empty content ("No tags found."):

  1. Press Escape — the input blurs (loses focus), but the popup remains visible.
  2. Press Escape again — the popup closes.

Expected behavior

  1. Press Escape — the popup closes, the input retains focus.

Per WAI-ARIA APG combobox pattern:

Escape: Dismisses the popup if it is visible.

The popup should close first. Focus should remain on the input.

Reproducible example

CleanShot.2026-03-03.at.06-12-20.mp4

Reproducible on the docs site: https://base-ui.com/react/components/autocomplete

Steps:

  1. Click the "Search tags" input in the hero example
  2. Type "asdf" (no matches — "No tags found." is shown)
  3. Press Escape — observe that the input loses focus instead of the popup closing

Base UI version

v1.2.0

Which browser are you using?

Chrome

Which OS are you using?

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions