Bug 236725

Summary: AX: clicking an input radio/checkbox should focus it
Product: WebKit Reporter: Giovanni Piller Cottrer <giovanni.piller>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: cdumez, tyler_w, wenson_hsieh
Priority: P2 Keywords: HasReduction
Version: Safari Technology Preview   
Hardware: All   
OS: macOS 12   
Attachments:
Description Flags
test case reduction none

Description Giovanni Piller Cottrer 2022-02-16 11:59:30 PST
Created attachment 452225 [details]
test case reduction

Right now, focus doesn't seem to change on click interactions.

This makes it difficult to use the keyboard to complement mouse interactions.

For example:
1) click on an input radio using the mouse
2) attempt to change the selected radio by using the up/down arrows
Expected: I'm able to modify my selection.
Actual: up/down arrows scroll the page

Or similarly, with checkboxes:
1) check an input checkbox using the mouse
2) attempt to uncheck it by pressing the spacebar
Expected: I'm able to modify my selection.
Actual: nothing happens (page scrolls)

**Note on <label>:** I would also expect that clicking an input's related <label> would move focus to it, but that's not the case.

To sum up: it appears that the only way to interact with a radio/checkbox via keyboard, is to first focus it via the keyboard itself. Mouse interactions won't focus those elements.

Webkit's behavior is inconsistent with current implementations of other browsers (tested on Firefox 97.0 and Chrome 98.0.4758.102).

I've reproduced it with and without the "Press Tab to highlight each item on a webpage" setting enabled, on the following builds:
- 15.3 (17612.4.9.1.5)
- TP Release 140 (Safari 15.4, WebKit 17614.1.1.5)
- Nightly 289904

The reduced test case (attached) is so simple that I have the feeling I'm missing something here. If so, sorry for wasting your time.
Comment 1 Alexey Proskuryakov 2022-02-17 19:46:36 PST
Safari matches platform behavior. It is inappropriate for controls to behave inconsistently just because they happen to be on a web page.

If you would like macOS behavior to change, please submit your feedback to Apple.

*** This bug has been marked as a duplicate of bug 22261 ***