Bug 251728 - Focus moves to items in a closed details element with tabindex=0
Summary: Focus moves to items in a closed details element with tabindex=0
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 252223
  Show dependency treegraph
 
Reported: 2023-02-03 16:42 PST by James Nurthen
Modified: 2024-03-15 04:33 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Nurthen 2023-02-03 16:42:42 PST
When tabbing on the keyboard focus moves to elements within a closed details element which have tabindex=0

See https://codepen.io/jnurthen/pen/QWBYQwN
Tab through the page

Observed: Focus disappears after the "Div with tabindex" summary for one tab stop before re-appearing on the "after" button
Expected: All focusable elements within a closed details element should be skipped by tab navigation.
Comment 1 Radar WebKit Bug Importer 2023-02-03 16:42:56 PST
<rdar://problem/105026467>
Comment 2 James Nurthen 2023-02-06 08:30:51 PST
Note: Press Tab to highlight each item on a webpage is checked.
You can see this issue in Adobe Documentation - example https://react-spectrum.adobe.com/react-spectrum/Button.html#props Under the Events or Layout expand/collapse region. (Note: this page has no visible focus indicator on safari for links right now which makes it slightly hard to operate.)
Comment 3 Ahmad Saleem 2023-03-10 00:46:05 PST
I think this will be fixed by bug 253680.

I tested this codepen (on local build with patch from above bug) and after tabbing, it goes to 'zoom' button on codepen rather than stuck somewhere to be not see.
Comment 4 sideshowbarker 2023-09-14 01:16:08 PDT
Ahmad, should we mark this issue as resolved?
Comment 5 Curtis Wilcox 2023-09-20 21:08:06 PDT
The above Codepen's contents have changed. The problem can't be reproduced with it as-is because the div with `tabindex="0"` is within another div with `hidden`.

bug 260523 documents the problem as being much broader than just elements with `tabindex`, it seems to affect all focusable elements except anchor links.

I can still reproduce the problem in Technology Preview 179.

https://cdpn.io/pen/debug/PoXqPYJ
Comment 6 Karl Dubost 2024-03-11 17:05:55 PDT
With STP 190, going to https://codepen.io/jnurthen/pen/QWBYQwN
This seems to have been fixed.
Comment 7 Curtis Wilcox 2024-03-15 04:33:25 PDT
It seems fixed in Safari 17.4.