Bug 236725 - AX: clicking an input radio/checkbox should focus it
Summary: AX: clicking an input radio/checkbox should focus it
Status: RESOLVED DUPLICATE of bug 22261
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: All macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2022-02-16 11:59 PST by Giovanni Piller Cottrer
Modified: 2022-02-17 19:46 PST (History)
3 users (show)

See Also:


Attachments
test case reduction (440 bytes, text/html)
2022-02-16 11:59 PST, Giovanni Piller Cottrer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***