Skip to content

Commit 4f045ae

Browse files
Merge pull request #230 from syncfusion/ExpanderLongPress
Fix SfExpander arrow color not restoring after cancelled touch gesture
2 parents 5b01ca2 + 68ef4a5 commit 4f045ae

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

maui/src/Expander/ExpanderHeader.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,35 @@ public void OnTouch(Internals.PointerEventArgs e)
604604
if (e.Action == PointerActions.Released)
605605
{
606606
Expander._effectsView.Reset();
607+
608+
// Restore icon color based on current state.
609+
if (IsMouseHover)
610+
{
611+
if (Expander.HasVisualStateGroups())
612+
{
613+
UpdateIconColor(Expander.HeaderIconColor);
614+
}
615+
else
616+
{
617+
UpdateIconColor(Expander.HoverIconColor);
618+
}
619+
}
620+
else if (!Expander.IsSelected)
621+
{
622+
UpdateIconColor(Expander.HeaderIconColor);
623+
}
607624
}
608625

609626
if (e.Action == PointerActions.Cancelled)
610627
{
611628
Expander._effectsView.Reset();
612629
IsMouseHover = false;
630+
631+
// Restore icon color to normal state since mouse hover is reset
632+
if (!Expander.IsSelected)
633+
{
634+
UpdateIconColor(Expander.HeaderIconColor);
635+
}
613636
}
614637
}
615638
}

0 commit comments

Comments
 (0)