CommunityToolkit / CommunityToolkit/Windows

SettingsExpander's internal SettingsCard using its Button content's as AutomationProperties.Name

オープン
#396 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
accessibility :accessibility: bug components::controls::settingscontrols
主要言語
C#
スター
1.1k
フォーク
166
PR マージ指標
30日以内にマージされた PR はありません

説明

### Describe the bug

When a SettingsCard's content is a button, it automatically sets its `AutomationProperties.Name` value to the button's content (as we can see [here](https://github.com/CommunityToolkit/Windows/blob/main/components/SettingsControls/src/SettingsCard/SettingsCard.cs#L100)). This is not always desirable and can lead to some bugs with the narrator as the screenshots below shows.

In the SettingsCard, a simple workaround is to set the `AutomationProperties.Name` manually. But in the SettingsExpander, there is no way to change the behavior of its internal SettingsCard. This SettingCard then inherits the Content of the button, which in some cases may not even be a text (it is an icon in our case), and then the narrator when focusing the button, narrates it as the name of the group the button is in (in the case the button have an accessible name different than its content, which is also our case).

A current workaround for it is to put the button inside another control of different type, a StackPanel for example, but it has the cost of nesting one more group into the UI.

My suggestion is that the SettingsExpander's SettingsCard should not always use its button's content as accessible name, but either use the Title of the card or having the possibility of the developer to choose if want this behavior or not when using the control. Or maybe this internal SettingsCard should not have any accessible name at all.

### Steps to reproduce

```text
- Create a SettingsExpander.
- Set its content to be a button.
- Have the button to have a AutomationProperties.Name different from its content.
- Activate the narrator and focus the button.
```

### Expected behavior

The narrator should say:
[Title of the SettingsExpander] group. [AutomationProperties.Name of the button] button.

Instead of:
[Content of the button] group. [AutomationProperties.Name of the button] button.

### Screenshots

![image](https://github.com/CommunityToolkit/Windows/assets/13912953/66ec7775-1c87-496a-b680-86db2a889e99)
![image](https://github.com/CommunityToolkit/Windows/assets/13912953/445ef3f6-8e65-4b04-97ea-d6ec7789fd1c)

### Code Platform

- [ ] UWP
- [X] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK

### Windows Build Number

- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 10 21H2 (Build 19044)
- [ ] Windows 10 22H2 (Build 19045)
- [X] Windows 11 21H2 (Build 22000)
- [ ] Other (specify)

### Other Windows Build number

_No response_

### App minimum and target SDK version

- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Windows 10, version 2104 (Build 20348)
- [ ] Windows 11, version 22H2 (Build 22000)
- [ ] Other (specify)

### Other SDK version

_No response_

### Visual Studio Version

2022

### Visual Studio Build Number

_No response_

### Device form factor

Desktop

### Additional context

_No response_

### Help us help you

No, I'm unable to contribute a solution.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

components/SettingsControls/src/SettingsCard/SettingsCard.cs の自動化名に関連するロジックから始め、SettingsExpander が内部の SettingsCard をどのように作成して構成するかを追跡します。AutomationProperties.Name がコンテンツと異なるボタンを使用して WinUI 3 のシナリオを再現し、Narrator が expander のタイトルをグループ名として、ボタンのアクセシブル名をボタン名として読み上げることを確認します。

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

評価

技術スタック
csharp
領域
accessibility, desktop
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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