Browse Source

fix: only remove knob transitions when dragging (#16993)

pull/17021/head
Jeremiah Simonsen 1 year ago
committed by GitHub
parent
commit
e19850f988
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      src/Avalonia.Controls/ToggleSwitch.cs

8
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);
}

Loading…
Cancel
Save