Skip to content

[List Item] Add Support for Editable Text in ListItems - #2292

Open
cbowdoin wants to merge 3 commits into
microsoft:mainfrom
cbowdoin:user/cbowdoin/ListItem/EditSupport
Open

cbowdoin wants to merge 3 commits into
microsoft:mainfrom
cbowdoin:user/cbowdoin/ListItem/EditSupport

Conversation

@cbowdoin

@cbowdoin cbowdoin commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Introduces the option to use a TextField in a ListItem instead of just Text.

  • Exposes a new init the lets clients specify the placeholder title string, the text currently in the text field, and the action they want to preform when the user submits the text in the text field.
  • When we have a placeholder text and the editable text we will construct the text field variant of the view instead of the standard Text view.

The Demo Controller will now feature an editable text toggle that lets you see what the ListItemCell looks like when the text is editable.

Note: This change also includes a refactor to make ListItemTitleTrailingAccessory a struct to prevent invalid combinations of titleTrailingAccessory where we are given an acessibilty string but not an image.

Breaking Change

The migration to ListItemTitleTrailingAccessory is a breaking change but no consumers should have adopted this new API yet so this should be safe.

Binary change

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

Verification

(how the change was tested, including both manual and automated tests)

Visual Verification
Before After
N/A
image

Pull request checklist

This PR has considered:

  • VoiceOver and Keyboard Accessibility
  • SwiftUI consumption (validation or new demo scenarios needed)
Microsoft Reviewers: Open in CodeFlow

@cbowdoin
cbowdoin requested a review from a team as a code owner September 11, 2026 17:20
@cbowdoin cbowdoin changed the title User/cbowdoin/list item/edit support [List Item] Add Support for Editable Text in ListItems Sep 11, 2026
.accessibilityIdentifier(AccessibilityIdentifiers.title)
.foregroundColor(titleColor)
.font(titleFont)
} else {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can tighten this up a bit -- could we either (A) make it always an HStack and then just vary the items in it, or (B) move some of this out to one or two @ViewBuilder blocks?

My main goal is to remove the duplicate modifiers as much as possible, since that's an easy place to end up with bugs.

This branch has not been deployed

No deployments
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.

3 participants