getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.31k stars 168 forks source link

[v4] Panel search highlights type selector by default #5650

Open lukasbestle opened 1 year ago

lukasbestle commented 1 year ago

Description

When opening the Panel search (via keyboard or mouse), the focus is on the type selector. To start searching, I need to press Tab.

Expected behavior

When opening the search, the focus should be in the search field. The type selector can still be reached via Shift-Tab.

Screenshots

Bildschirmfoto 2023-09-17 um 13 06 23

To reproduce

  1. Click on "Search" in the Panel sidebar
  2. See result

Your setup

Kirby Version
v4/develop branch

Your system (please complete the following information) Safari 16.6 on macOS 13.5.2

distantnative commented 1 year ago

Works in Chrome, but yes in Safari I see the same

lukasbestle commented 1 year ago

Yep, can confirm it works in Chrome.

distantnative commented 1 year ago

Observation: when our focus helper function gets called it does not proceed as document.activeElement is within the dialog already - and already set to the button. Even though the input has the autofocus attribute.

Wondering if that's just a Safari behaviour: focusing the first focusable element in a dialog.