From e19850f988874a5bdd0135c8f113c19334afe3bc Mon Sep 17 00:00:00 2001 From: Jeremiah Simonsen <48595112+jsimonsen@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:04:13 -0400 Subject: [PATCH] fix: only remove knob transitions when dragging (#16993) --- src/Avalonia.Controls/ToggleSwitch.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Controls/ToggleSwitch.cs b/src/Avalonia.Controls/ToggleSwitch.cs index 1bea3b17a6..30f9de12c4 100644 --- a/src/Avalonia.Controls/ToggleSwitch.cs +++ b/src/Avalonia.Controls/ToggleSwitch.cs @@ -255,14 +255,14 @@ namespace Avalonia.Controls { if (_knobsPanelPressed) { - if(_knobsPanel != null) - { - _knobsPanel.Transitions = null; - } var difference = e.GetPosition(_switchKnob) - _switchStartPoint; if ((!_isDragging) && (System.Math.Abs(difference.X) > 3)) { + if (_knobsPanel != null) + { + _knobsPanel.Transitions = null; + } _isDragging = true; PseudoClasses.Set(":dragging", true); }