RESOLVED DUPLICATE of bug 264410 265989
AX: Button label is not announced when inside shadowDOM
https://bugs.webkit.org/show_bug.cgi?id=265989
Summary AX: Button label is not announced when inside shadowDOM
Istvan Tutto
Reported 2023-12-07 01:44:40 PST
When a button's label is provided via a slot that has a `display` style assigned to it, Safari will ignore the slotted content and announce the button without the label. Demo: https://codepen.io/istutto/pen/ZEwwzmv How to reproduce: For simplicity, I bypass the custom element definition (see demo above for full example). Load a page with the following DOM: <button-label-fail> <template shadowrootmode="open"> <button><slot style="display: inline"></slot></button> </template> Test label </button-label-fail> Use the inspector of the developer tools on the `button` inside the shadowDOM and not how the button's label is not associated. This is even more obvious when using VoiceOver, as it will only announce `button` when focused. --- This setup used to work in previous Safari releases (early v17 and before). We own and maintain a design system that provides components for millions of visitors daily. There have been many slot-related bugs in Safari recently, but this is the most severe regression I've seen for a while.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-12-07 01:44:50 PST
Tyler Wilcock
Comment 2 2023-12-18 15:29:11 PST
This should be fixed by: https://bugs.webkit.org/show_bug.cgi?id=264410 Which shipped in macOS 14.2 and iOS 17.2. Please let me know if you experience otherwise. Thanks!
Tyler Wilcock
Comment 3 2023-12-18 15:29:24 PST
*** This bug has been marked as a duplicate of bug 264410 ***
Note You need to log in before you can comment on or make changes to this bug.