Skip to content

[focus] Focus is lost after clicking “Submit search” button #914

@coseeian

Description

@coseeian

Title

[focus] Focus is lost after clicking “Submit search” button

Description

When a user clicks the “Submit search” button, the button is removed from the DOM and no programmatic focus management is applied. As a result, keyboard and screen reader users lose track of their place in the interface, which creates confusion and interrupts their workflow. This issue presents a barrier for users who rely on assistive technologies or keyboard navigation, as they cannot easily determine the next actionable element or understand the result of their action.

Steps to Reproduce

  1. Navigate to /search/
  2. Locate the “Search through site content” input field.
  3. Enter a search term into the input.
  4. Move focus on the “Submit search” button and click it.
  5. Observe that the “Submit search” button disappears and a “Clear search input” button appears.
  6. Note that focus is not placed on any element.

Actual Behavior

After the “Submit search” button is click and removed, focus is lost and resets to the browser’s default navigation starting point (e.g., the document <body> or address bar).

Expected Behavior

When the “Submit search” button is click and replaced, focus should be programmatically moved to the logical appropriate interactive element—such as the “Clear search input” button or returned to the “Search through site content” input field—so that users can seamlessly continue their interaction.

Environments

No response

Suggested Fix

Implement focus management logic so that after the “Submit search” button is clicked and removed:

  • Option 1: Move focus to the “Clear search input” button that appears.
  • Option 2: Return focus to the “Search through site content” input field.

Reference

What is your operating system?

None

Web browser and version

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions