You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Dialog shows the focus ring on its opening and returning focus after a tap in WebKit #7306
When a pointer opens a Dialog, it moves focus to the [data-autofocus] target right after showModal() (AlertDialog's Cancel), and on close it returns focus to the control that opened it. Both are programmatic focus moves that follow pointer input. architecture:interaction-modality INV1 says such focus does not show the shared focus indicator.
Chromium honours that on its own: :focus-visible is false for a script focus that follows a click, so no ring paints. WebKit does not: a tap or click on a button does not focus the button there, and the script focus that follows matches :focus-visible. On an iPhone the confirmation opens with a ring around Cancel, and after the dialog closes, the control it returns to wears a ring again.
component:Dialog keeps both focus moves (FR2, FR4) and leaves "focus-ring appearance and modality detection" to the interaction authority, so the fix sits at that boundary: keep the moves and hide the indicator after pointer input, as DropdownMenu already does for the trigger it refocuses (useFocusReturnVisibility). INV6 keeps the modality tracker internal, so a host cannot do this itself.
Reproduction
In Safari on iOS or macOS, tap or click a button that opens an AlertDialog.
Cancel opens with a focus ring.
Tap Cancel: the button that opened the dialog shows a focus ring.
With the keyboard (Enter on the button, Escape to close) both rings are expected. In Chromium neither pointer ring paints.
Activity
fix(Dialog): hide the focus ring on pointer-initiated focus moves in …