DataGrid ComboBox: keyboard-focused item uses an undefined brush key (MaterialDesign.Brush.TextBox.ComboBoxHover)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 88/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- csharp
- 領域
- desktop-dev
研究方向
問題位於 src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.DataGrid.ComboBox.xaml 約第 60 行,即項目容器範本中鍵盤焦點的 MultiTrigger。將那裡的鍵與第 53 行滑鼠懸停觸發器所用的鍵進行比較,並檢查它是否在 MaterialDesignTheme.Light.xaml 和 Dark.xaml 中定義。當使用方向鍵導覽時,獲得焦點的項目會被高亮顯示,即完成;你可以執行範例應用程式中的 DataGrid ComboBox 來確認。
由索引模型根據 Issue 內容生成。
描述
Bug explanation
src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.DataGrid.ComboBox.xaml, line 60, in the item container template of the DataGrid ComboBox:
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsKeyboardFocused" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource MaterialDesign.Brush.TextBox.ComboBoxHover}" />
</MultiTrigger>
No resource with the key MaterialDesign.Brush.TextBox.ComboBoxHover is defined anywhere in the repository (GitHub code search finds only this line). The trigger right above it — the mouse-over case, line 53 — uses MaterialDesign.Brush.DataGrid.ComboBoxHover, which is defined in both MaterialDesignTheme.Light.xaml and MaterialDesignTheme.Dark.xaml (line 39), and lines 171 and 297 use the same key. So this looks like the keyboard-focus trigger was meant to use it too.
Since it is a DynamicResource, nothing throws: the background just doesn't change when an item gets keyboard focus, so someone moving through the dropdown with the arrow keys gets no highlight on the focused item. I found this by reading the source and haven't run it, so apologies if I'm missing something.
Suggested change (line 60):
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource MaterialDesign.Brush.DataGrid.ComboBoxHover}" />
The line is the same in 5.4.0 and on master at 0877280.
Found with XamlKeys, a static checker for XAML resource keys I'm working on.
Version
5.4.0
- 主要語言
- C#
- 星號
- 16.3k
- 分支
- 3.5k
- 平均合併
- 4 小時 25 分鐘
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MaterialDesignInXAML/MaterialDesignInXamlToolkit 的其他 Issue
-
MaterialDesignChoiceChipListBoxItem missing 'Path=Name' in GroupName binding causes selection conflict between ListBoxes可能已有人在做 @corvinsz 於 12 天前認領。 未關閉bug evaluation required
難度 1/5 1-3 小時 新手友好度 78/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4118 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement up-for-grabs
難度 2/5 1-3 小時 新手友好度 68/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#2485 ·
維護者通常 1 天內回覆
-
enhancement evaluation required
難度 3/5 半天 新手友好度 30/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4120 · 1 則留言 ·
維護者通常 1 天內回覆
-
Add Semantic, Theme-Aware Colors可能已有人在做 @corvinsz 於 22 天前認領。 未關閉enhancement
難度 4/5 3-5 天 新手友好度 48/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4114 · 1 個 reaction ·
維護者通常 1 天內回覆
-
[Feature Request] Proposals for input/display improvements and hexadecimal support in NumericUpDown未關閉enhancement evaluation required
難度 5/5 一週以上 新手友好度 15/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4108 ·
維護者通常 1 天內回覆
查看 MaterialDesignInXAML/MaterialDesignInXamlToolkit 的全部 Issue
相似的 Issue
-
ready-for-agent tech-debt
難度 1/5 1-3 小時 新手友好度 85/100
DigiBanks99/menlo#640 ·
維護者通常 1 天內回覆
-
ci
難度 1/5 1 小時以內 新手友好度 62/100
OpenTabletDriver/OpenTabletDriver#5283 ·
維護者通常 3 天內回覆
-
area / templates
難度 2/5 1-3 小時 新手友好度 66/100
bitfoundation/bitplatform#15109 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
aikido critical security
難度 1/5 1 小時以內 新手友好度 72/100
dequelabs/axe-core-nuget#305 ·