Skip to content

Commit

Permalink
fix: Remove unnecessary TextBlock from MenuItem template
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTasler committed Feb 16, 2025
1 parent b3ae87f commit 5e890fa
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions src/Wpf.Ui/Controls/Menu/MenuItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@
ContentSource="Header"
RecognizesAccessKey="True"
TextElement.Foreground="{TemplateBinding Foreground}" />
<!-- TextBlock added so that screen readers don't try to read Icon -->
<TextBlock
Grid.Column="0"
Grid.ColumnSpan="3"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Margin="-10"
Background="Black"
FontSize="1"
IsHitTestVisible="False"
Opacity="0"
Text="{TemplateBinding AutomationProperties.Name}" />
</Grid>

<Popup
Expand Down Expand Up @@ -193,18 +181,6 @@
ContentSource="Header"
RecognizesAccessKey="True"
TextElement.Foreground="{TemplateBinding Foreground}" />
<!-- TextBlock added so that screen readers don't try to read Icon -->
<TextBlock
Grid.Column="0"
Grid.ColumnSpan="2"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Margin="-10"
Background="Black"
FontSize="1"
IsHitTestVisible="False"
Opacity="0"
Text="{TemplateBinding AutomationProperties.Name}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
Expand Down Expand Up @@ -288,19 +264,6 @@
FontSize="11"
Foreground="{DynamicResource TextFillColorDisabledBrush}"
Text="{TemplateBinding InputGestureText}" />

<!-- TextBlock added so that screen readers don't try to read Icon -->
<TextBlock
Grid.Column="0"
Grid.ColumnSpan="4"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Margin="-10"
Background="Black"
FontSize="1"
IsHitTestVisible="False"
Opacity="0"
Text="{TemplateBinding AutomationProperties.Name}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
Expand Down Expand Up @@ -371,19 +334,6 @@
FontSize="{TemplateBinding FontSize}"
Symbol="ChevronRight20" />
</Grid>

<!-- Fix double narration from mousing over the button and then the associated text -->
<TextBlock
Grid.Column="0"
Grid.ColumnSpan="3"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Margin="-10"
Background="Black"
FontSize="1"
IsHitTestVisible="False"
Opacity="0"
Text="{TemplateBinding AutomationProperties.Name}" />
</Grid>
</Border>

Expand Down

0 comments on commit 5e890fa

Please sign in to comment.