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

オープン 初心者向け
#613 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, kotlin, swift

調査の方向性

Commands/Menu.swift の RenderDropdownMenuItem から始めます。ここではチェックアイコンの contentDescription が "selected" にハードコードされており、isSelected 分岐が 2 つの DropdownMenuItem 呼び出しを構築しています。そこで modifier.semantics がどのように適用されているかを読み、英語の説明を削除して、両方の項目に selected セマンティクス状態を付けます。完了条件は、チェックアイコンにハードコードされたテキストがなく、フランス語ロケールのエミュレーター上で TalkBack がアプリの言語で選択状態をアナウンスすること、または生成された Kotlin が両方の項目でセマンティクスを示すことです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Swift
スター
332
フォーク
91
平均マージ
4日 9時間
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

skiptools/skip-ui のほかの issue

skiptools/skip-ui の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。