From 80be90dcea9264e9477f40c0424e3da52f06b435 Mon Sep 17 00:00:00 2001 From: Melissa Date: Mon, 19 Jan 2026 11:09:20 +0100 Subject: [PATCH] Fixed broken accessibility properties in ScrollBar control (#20483) * Fixed broken accessibility properties in ScrollBar control * Prefer setting Thumb name in xaml instead * Fixed broken accessibility propertes in ScrollBar control on Simple theme --- .../Controls/ScrollBar.xaml | 30 ++++++++++++------- .../Controls/ScrollBar.xaml | 30 ++++++++++++------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml b/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml index 1107bf2c27..8af22dd0b9 100644 --- a/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml +++ b/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml @@ -137,7 +137,8 @@ Grid.Row="0" Focusable="False" MinWidth="{DynamicResource ScrollBarSize}" - Height="{DynamicResource ScrollBarSize}"> + Height="{DynamicResource ScrollBarSize}" + AutomationProperties.Name="Line up"> @@ -155,19 +156,22 @@ + Focusable="False" + AutomationProperties.Name="Page up"/> + Focusable="False" + AutomationProperties.Name="Page down"/> + RenderTransformOrigin="100%,50%" + AutomationProperties.Name="Position"/> + Height="{DynamicResource ScrollBarSize}" + AutomationProperties.Name="Line down"> @@ -215,7 +220,8 @@ Grid.Column="0" Focusable="False" MinHeight="{DynamicResource ScrollBarSize}" - Width="{DynamicResource ScrollBarSize}"> + Width="{DynamicResource ScrollBarSize}" + AutomationProperties.Name="Column left"> @@ -232,19 +238,22 @@ + Focusable="False" + AutomationProperties.Name="Page left"/> + Focusable="False" + AutomationProperties.Name="Page right"/> + RenderTransformOrigin="50%,100%" + AutomationProperties.Name="Position"/> + Width="{DynamicResource ScrollBarSize}" + AutomationProperties.Name="Column right"> diff --git a/src/Avalonia.Themes.Simple/Controls/ScrollBar.xaml b/src/Avalonia.Themes.Simple/Controls/ScrollBar.xaml index e8dfd3736f..a7f11ec24c 100644 --- a/src/Avalonia.Themes.Simple/Controls/ScrollBar.xaml +++ b/src/Avalonia.Themes.Simple/Controls/ScrollBar.xaml @@ -18,7 +18,8 @@ MinWidth="{DynamicResource ScrollBarThickness}" VerticalAlignment="Center" Classes="repeat" - Focusable="False"> + Focusable="False" + AutomationProperties.Name="Column left"> + Focusable="False" + AutomationProperties.Name="Page left"/> + Focusable="False" + AutomationProperties.Name="Page right"/> - + + Focusable="False" + AutomationProperties.Name="Column right"> @@ -68,7 +73,8 @@ MinHeight="{DynamicResource ScrollBarThickness}" HorizontalAlignment="Center" Classes="repeat" - Focusable="False"> + Focusable="False" + AutomationProperties.Name="Line up"> + Focusable="False" + AutomationProperties.Name="Page up"/> + Focusable="False" + AutomationProperties.Name="Page down"/> - + + Focusable="False" + AutomationProperties.Name="Line down">