Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

clicking the magnifying glass doesn't focus the search input field #320

Open
skierpage opened this issue Nov 24, 2021 · 1 comment
Open

Comments

@skierpage
Copy link

Open flathub.org in Firefox or chromium-browser, and click the magnifying glass icon in the header.
A text field appears with "Search apps" placeholder text, but this does not have the input focus. You have to click a second time to type anything into it, or press [Shift+Tab] to move the focus to it A minor detail, but it feels weird.

Looking at the HTML for the search box,

<input _ngcontent-bgw-c94="" id="search-box" type="search" placeholder="Search apps"
   autofocus="" autocapitalize="none" class="search-box">

you would think the autofocus="" would put the input focus there.

In fact, if you bring up a flathub page and immediately type BAZINGA, then click the magnifying glass, the search box appears with your typed text in it. So the initial input focus is set to this invisible field (you can [Tab] and [Shift+Tab] from it to the magnifying glass and 3-dot menu), but when you click on the magnifying glass, your keyboard focus doesn't return to the search box. After clicking the magnifying glass, typing document.activeElement in the browser developer tools console displays <button _ngcontent-bgw-c94="" mat-icon-button="" class="mat-focus-indicator ...">, not the input#search-box.search-box. If you tab backwards and forwards you can see the input focus ring highlight "behind" the search box where the magnifying glass was visible.

@hotlittlewhitedog
Copy link

#225

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants