WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
260637
:focus-visible doesn't work when mouse is clicked
https://bugs.webkit.org/show_bug.cgi?id=260637
Summary
:focus-visible doesn't work when mouse is clicked
shanmen.ng
Reported
2023-08-23 16:57:47 PDT
Reproduction steps: 1.
https://wpt.live/css/selectors/focus-visible-script-focus-014.html
2. Click on the body and click on the input. 3. Press tab. 4. Observe the test has failed. This doesn't happen on just the body, but when the mouse is clicked, e.g.:
https://jsfiddle.net/xrL26jc7/
, click on the first input, then the second input and press tab. The focus-visible styles aren't applied.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-08-30 16:58:13 PDT
<
rdar://problem/114732237
>
freddiepingpong
Comment 2
2024-07-30 09:21:19 PDT
Looks like
https://wpt.fyi/results/css/selectors/focus-visible-028.html
now also tests for a related issue. Background:
https://github.com/web-platform-tests/wpt/pull/44873
> If the current modality is mouse, and focus is programmatically sent to another element, :focus-visible does not match, which is expected. If you then use keyboard afterwards, :focus-visible should match, as the current modality switched from mouse to keyboard. This functionality does not work in Safari if the following is true:
> The function that handles key events and .focus() utilizes .preventDefault(). > User's modality is not keyboard when focus is initially set programmatically.
This bug is readily apparent when using the keyboard to navigate our table (
https://nimble.ni.dev/storybook/?path=/story/components-table--table
). Keyboard only works well in all browsers, but keyboard navigation after a single mouse click produces wildly varying focus-visible behavior (only WebKit).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug