Bug 247416

Summary: focus-visible is triggered when opening dialog using mouse
Product: WebKit Reporter: Andreas Ehrencrona <andreas.ehrencrona>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Minor CC: akeerthi, a_protyasha, ben.carr, brian, cdumez, kamil.zacek, lily_spiniolas, matias.emanuel.surdi, mmaxfield, ntim, Rican7, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
Attachments:
Description Flags
Repro none

Andreas Ehrencrona
Reported 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.
Attachments
Repro (616 bytes, text/html)
2022-11-03 01:33 PDT, Andreas Ehrencrona
no flags
Radar WebKit Bug Importer
Comment 1 2022-11-10 00:34:18 PST
Note You need to log in before you can comment on or make changes to this bug.