From 4327c36c664cec13e639eaf680e60e8bf45c0148 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 23 Feb 2021 15:42:06 +0100 Subject: [PATCH] Fix slider keyboard interaction. - Now `Slider` can be itself focused, handle the key events from the control, not the `Track`. - Reverse the direction in which the page up/down keys move the slider in order to work as expected - Make up/down arrows work as well as left/right Fixes #4205 --- src/Avalonia.Controls/Slider.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Avalonia.Controls/Slider.cs b/src/Avalonia.Controls/Slider.cs index 849b768221..b3dfcf3228 100644 --- a/src/Avalonia.Controls/Slider.cs +++ b/src/Avalonia.Controls/Slider.cs @@ -83,7 +83,6 @@ namespace Avalonia.Controls private IDisposable _increaseButtonSubscription; private IDisposable _increaseButtonReleaseDispose; private IDisposable _pointerMovedDispose; - private IDisposable _trackOnKeyDownDispose; private const double Tolerance = 0.0001; @@ -166,7 +165,6 @@ namespace Avalonia.Controls _increaseButtonSubscription?.Dispose(); _increaseButtonReleaseDispose?.Dispose(); _pointerMovedDispose?.Dispose(); - _trackOnKeyDownDispose?.Dispose(); _decreaseButton = e.NameScope.Find