Skip to content

Commit

Permalink
Merge pull request #98 from xiaohai-huang/fix-active-state-for-button
Browse files Browse the repository at this point in the history
Fixed `:active` not working for button
  • Loading branch information
KurtGokhan authored Nov 9, 2023
2 parents bea21b3 + ac50f60 commit 6e05e71
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ public void OnPointerUp(MouseUpEvent eventData)

protected override void RegisterCallbacksOnTarget()
{
target.RegisterCallback<MouseDownEvent>(OnPointerDown);
target.RegisterCallback<MouseDownEvent>(OnPointerDown,
target is Button ? TrickleDown.TrickleDown : TrickleDown.NoTrickleDown);
target.RegisterCallback<MouseUpEvent>(OnPointerUp);
}

protected override void UnregisterCallbacksFromTarget()
{
target.UnregisterCallback<MouseDownEvent>(OnPointerDown);
target.UnregisterCallback<MouseDownEvent>(OnPointerDown,
target is Button ? TrickleDown.TrickleDown : TrickleDown.NoTrickleDown);
target.UnregisterCallback<MouseUpEvent>(OnPointerUp);
}
}
Expand Down

0 comments on commit 6e05e71

Please sign in to comment.