Menu / Picker dropdown: selected item announced as hard-coded English "selected", not as a selection state

Open Beginner friendly
#613 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
android, kotlin, swift

Research direction

Start in Commands/Menu.swift at RenderDropdownMenuItem, where the check icon's contentDescription is hard-coded to "selected" and the isSelected branch builds two DropdownMenuItem calls. Read how modifier.semantics is applied there, then remove the English description and attach a selected semantics state to both items. Done when the check icon has no hard-coded text and TalkBack announces the selection state in the app's language on a French-locale emulator, or the generated Kotlin shows the semantics on both items.

Written by the indexing model from the issue text.

Description

Environment

  • skip-ui 1.63.0 (the code below is unchanged in 1.66.4), Fuse app, native mode, Material3, TalkBack on an Android 15 emulator, app in French

What happens

In the dropdown of a menu-style Picker (or a Menu with a selection), the selected item is announced as "selected. 3 hours": the word "selected" is read as text, in English whatever the app or system language, and it is not the selection state (TalkBack does not say "Selected" the way it does for a selected element).

Why

Commands/Menu.swift, RenderDropdownMenuItem:

selectedIcon = { Icon(imageVector: Icons.Outlined.Check, contentDescription: "selected") }

A hard-coded English content description on the check icon, and no selected semantics on the item.

Suggested fix

-                selectedIcon = { Icon(imageVector: Icons.Outlined.Check, contentDescription: "selected") }
+                selectedIcon = { Icon(imageVector: Icons.Outlined.Check, contentDescription: nil) }
...
+            let modifierEtat = modifier.semantics { selected = isSelected }
             (pass modifierEtat to both DropdownMenuItem calls of the isSelected branch)

TalkBack then announces the state in the user's language ("Sélectionné" in French), as VoiceOver does with its checkmark.

Dominant language
Swift
Stars
334
Forks
95
Avg merge
2d 10h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from skiptools/skip-ui

All issues in skiptools/skip-ui

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.