Skip to content

Commit

Permalink
Merge pull request #56 from davepruitt/main
Browse files Browse the repository at this point in the history
Fixing two issues with ToggleSwitch control
  • Loading branch information
jsuarezruiz authored Apr 29, 2023
2 parents 08ca4b3 + b9ca4d3 commit 56f942d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/AlohaKit/Controls/ToggleSwitch/ToggleSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ void UpdateIsOn()
Toggled?.Invoke(this, new ToggledEventArgs(IsOn));

Invalidate();

AnimateToggle();
}

void UpdateHasShadow()
Expand All @@ -148,9 +150,10 @@ void UpdateHasShadow()

void OnToggleSwitchStartInteraction(object sender, TouchEventArgs e)
{
IsOn = !IsOn;

AnimateToggle();
if (IsEnabled)
{
IsOn = !IsOn;
}
}

void AnimateToggle()
Expand Down

0 comments on commit 56f942d

Please sign in to comment.