Repository navigation
Activate a clickable SettingsCard on release instead of on press - #5478
Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intoOct 6, 2026
Merged
Conversation
SettingsCard invoked the click from its PointerPressed handler, so a touch screen fired it the instant the finger landed: the press synthesizes a left button down before the user has moved far enough for Avalonia's ScrollGestureRecognizer to claim the gesture. The page scrolled and the card under the initial touch navigated away at the same time, which is what made the Settings and Package Manager Preferences pages unusable with touch. The card marking the press handled does not suppress the scroll, because the recognizers run as handledEventsToo class handlers. Follow the protocol Avalonia's own Button uses. The press only records that the card saw it; the release invokes the click, gated on the initial button being the left one and on the release point still hitting the card; and PointerCaptureLost clears the pending press. That last handler is what cancels the navigation: when the scroll starts, ScrollGestureRecognizer captures the pointer, which routes through Pointer.CaptureGestureRecognizer to Capture(null) and raises PointerCaptureLost on every ancestor of the implicitly captured element, the card included. The touch end is then delivered to the recognizer rather than to the card. Keyboard activation through Enter and Space is unchanged. Fixes #5475
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation follows Avalonia button semantics and addresses the touch-scrolling conflict without changing keyboard activation.
Review effort: Balanced
Findings: None
What changed in this PR
Moves clickable SettingsCard activation from pointer press to release, preventing touch-scroll gestures from triggering navigation.
Changes:
- Tracks valid left-button presses.
- Activates only when released over the card.
- Cancels pending activation when pointer capture is lost.
| File | Description |
|---|---|
src/UniGetUI.Avalonia/Views/Controls/Settings/SettingsCard.cs |
Implements release-based pointer activation and scroll cancellation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "99886650-c19f-11f1-95fd-8f3398189180",
"headSha": "5abb18cd82347f51d3754126961dca2a9445aa36",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
fix/5475-settings-touch-scroll
branch
October 6, 2026 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SettingsCard invoked the click from its PointerPressed handler, so a touch screen fired it the instant the finger landed: the press synthesizes a left button down before the user has moved far enough for Avalonia's ScrollGestureRecognizer to claim the gesture. The page scrolled and the card under the initial touch navigated away at the same time, which is what made the Settings and Package Manager Preferences pages unusable with touch. The card marking the press handled does not suppress the scroll, because the recognizers run as handledEventsToo class handlers.
Follow the protocol Avalonia's own Button uses. The press only records that the card saw it; the release invokes the click, gated on the initial button being the left one and on the release point still hitting the card; and PointerCaptureLost clears the pending press. That last handler is what cancels the navigation: when the scroll starts, ScrollGestureRecognizer captures the pointer, which routes through Pointer.CaptureGestureRecognizer to Capture(null) and raises PointerCaptureLost on every ancestor of the implicitly captured element, the card included. The touch end is then delivered to the recognizer rather than to the card.
Keyboard activation through Enter and Space is unchanged.
Fixes #5475