Summary: | Custom element with delegatesFocus does not focus if inner element is not first child | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Elizabeth Mitchell <lizmitchell> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED INVALID | ||||||
Severity: | Normal | CC: | mike, rniwa, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari 16 | ||||||
Hardware: | Mac (Apple Silicon) | ||||||
OS: | macOS 13 | ||||||
URL: | https://jsbin.com/ranuvuhiri/edit?html,output | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 148695 | ||||||
Attachments: |
|
Description
Elizabeth Mitchell
2023-08-21 12:46:24 PDT
Hm... the focus is set. We're somehow not applying :focus rule, however. Created attachment 470649 [details]
Reduction
Oh, the issue is simply that x-button becomes width 0px because it's a display: inline. If you set display: block on x-button or replace div with span, the dotted red line renders correctly. Note that buttons are not focusable by mouse clicks on Apple platforms by default. If you want to make a button focusable, set tabindex=0 on button elements. As such, this is behaving correctly. |