Skip to content

Focus search input when search button is clicked with empty input - #2324

Open
officialasishkumar wants to merge 1 commit into
atk4:developfrom
officialasishkumar:search_button_focus
Open

officialasishkumar wants to merge 1 commit into
atk4:developfrom
officialasishkumar:search_button_focus

Conversation

@officialasishkumar

@officialasishkumar officialasishkumar commented Nov 7, 2026 •

Copy link
Copy Markdown

fix #2166

Clicking the magnifying glass in JsSearch did nothing when no text was entered, so users had to click a 2nd time into the input to start typing. The input is now focused in that case.

As requested in #2166 (comment), the other behaviour is kept: with text entered the button still submits the search, and with an active search it still clears it. This applies with autoQuery both enabled and disabled, because only the empty input case changed.

Added a generic Element ... should be focused Behat step and a grid.feature scenario, which fails without the JS change. public/js was rebuilt using npm run build. The baseline build was byte-identical to the committed files, so the bundle diff contains only this change.

Clicking the magnifying glass of JsSearch did nothing when no text was
entered, so users had to click a 2nd time into the input to start typing.

Move focus to the input in that case. Clicking the button with a text
entered still submits the search and clicking it with an active search
still clears the search.

Add a generic "Element ... should be focused" Behat step to test this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Click on magnifying glass in search should focus search field

1 participant