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
-
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 ·
-
:watch: Not Triaged dotnet-fundamentals/svc install/subsvc
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复