Skip to content

[ListItem] Add support for detailed content, address accessibility issue #2191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alexanderboswell
Copy link
Contributor

@alexanderboswell alexanderboswell commented Jul 18, 2025

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Detailed content support

To allow the use of generics for content that is displayed with the detailed button ... is selected, adding the ability to pass that into the ListItem. The reasoning for this is that we need to correctly display a sheet from the button. To be able to do that we need to know the content to display in the sheet. This requires the client to pass in that view to ListItem. With using generics, we can achieve this to optimize for view layout instead of using Any View which would get redrawn more often.

Accessibility bug

When the List item is tappable, we aren't correctly grouping the accessibility elements. This makes it so the whole view gets correct focus in VoiceOver/full keyboard access, but provides the action to tap on the List item show up more than once. For example, in full keyboard access, when focused on a list item and pressing tab + z it shows a list of the sub actions that can be taken on the list item. Currently, that list of actions also includes the action that occurs when the list item is selected. This should not occur, it should only be sub actions, or in the case of List item, the content in the trailing view that has a tap gesture associated with it, like a button.

Binary change

(how is our binary size impacted -- see https://github.com/microsoft/fluentui-apple/wiki/Size-Comparison)

Verification

Visual Verification
Description Image
The detailed content showing when it is provided Screenshot 2025-07-18 at 1 26 20 PM
The list item still gets correct VoiceOver focus Screenshot 2025-07-18 at 1 26 11 PM
When Tab+z is pressed, only the sub actions are shown as options Screenshot 2025-07-18 at 1 26 04 PM

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@alexanderboswell alexanderboswell requested a review from a team as a code owner July 18, 2025 20:44
@alexanderboswell alexanderboswell enabled auto-merge (squash) July 18, 2025 20:46
@alexanderboswell alexanderboswell merged commit 8b33246 into microsoft:main Jul 21, 2025
7 checks passed
@alexanderboswell alexanderboswell deleted the user/alboswel/ListItemUpdates branch July 21, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants