Skip to content

fix(HyperlinkButton): raise Click only once, drop RaiseHyperlinkClicks - #436

Merged
NotYoojun merged 1 commit into
mainfrom
fix/407-3
Jul 25, 2026
Merged

fix(HyperlinkButton): raise Click only once, drop RaiseHyperlinkClicks#436
NotYoojun merged 1 commit into
mainfrom
fix/407-3

Conversation

@NotYoojun

Copy link
Copy Markdown
Member

Hyperlink.ClickEvent is registered as ButtonBase.ClickEvent.AddOwner(...), i.e. it is the very same routed event as the button's own Click. The inner Hyperlink is a logical child, so the Click raised by DoClick() bubbled back up to the HyperlinkButton and fired the user's Click handler a second time on every single click (#407).

Mark the inner Hyperlink's Click as handled so it no longer bubbles: DoClick() still performs navigation while Click is raised exactly once by base.OnClick(). DoClick() is now only invoked when NavigateUri is set.

Remove RaiseHyperlinkClicks: it was a workaround that defaulted to the buggy double-raise behaviour and, when turned off, also disabled navigation because both were coupled to the same DoClick() call.

⚠️ BREAKING CHANGE: the RaiseHyperlinkClicks property has been removed. Remove any references to it; the double-Click it worked around no longer occurs.

Fixes #407

Hyperlink.ClickEvent is registered as ButtonBase.ClickEvent.AddOwner(...), i.e. it is the very same routed event as the button's own Click. The inner Hyperlink is a logical child, so the Click raised by DoClick() bubbled back up to the HyperlinkButton and fired the user's Click handler a second time on every single click (#407).

Mark the inner Hyperlink's Click as handled so it no longer bubbles: DoClick() still performs navigation while Click is raised exactly once by base.OnClick(). DoClick() is now only invoked when NavigateUri is set.

Remove RaiseHyperlinkClicks: it was a workaround that defaulted to the buggy double-raise behaviour and, when turned off, also disabled navigation because both were coupled to the same DoClick() call.

BREAKING CHANGE: the RaiseHyperlinkClicks property has been removed. Remove any references to it; the double-Click it worked around no longer occurs.

Fixes #407
Copilot AI review requested due to automatic review settings July 25, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@NotYoojun
NotYoojun merged commit 9464987 into main Jul 25, 2026
2 checks passed
@NotYoojun
NotYoojun deleted the fix/407-3 branch July 25, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] HyperlinkButton Click Event Firing Twice

2 participants