Bug 247416 - focus-visible is triggered when opening dialog using mouse
Summary: focus-visible is triggered when opening dialog using mouse
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 13
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-03 01:33 PDT by Andreas Ehrencrona
Modified: 2024-01-08 00:46 PST (History)
6 users (show)

See Also:


Attachments
Repro (616 bytes, text/plain)
2022-11-03 01:33 PDT, Andreas Ehrencrona
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Ehrencrona 2022-11-03 01:33:30 PDT
Created attachment 463380 [details]
Repro

When opening a dialog using `showModal`, the first focusable element is given focus. So far so good.

However, the element always receives a focus highlight. In fact, `:focus-visible` is triggered. I would expect this not happen if I use a mouse to open the dialog.

See the attached reproduction, where clicking the open button shows a dialog with button with a pink border. The pink border is from a `:focus-visible` style.
Comment 1 Radar WebKit Bug Importer 2022-11-10 00:34:18 PST
<rdar://problem/102181392>