Repository navigation
fix(input): Prevent touch holds from raising taps and item clicks (backport #25531) (backport #25790) - #25956
Merged
agneszitte merged 16 commits intoNov 3, 2026
Conversation
2 of 5 tasks
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25956/docs/index.html |
agneszitte
approved these changes
Nov 3, 2026
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.
GitHub Issue: closes unoplatform/kahua-private#550
PR Type:
🐞 Bugfix
What changed? 🚀
On Skia, as seen in iPad Safari on WebAssembly, long-pressing a clickable ListView/GridView item opens its context menu, and releasing the finger then also raises
Tapped/ItemClickand selects the item. Long-pressing blank app space also selects the host. There were three causes. AUIElement'sGestureRecognizerreported a touch or pen hold as a tap wheneverRightTapwasn't enabled, and that hold could also start aDoubleTapped. It also missed holds where the holding timer fired before the pointer timestamps reached 800 ms. Separately,SelectorItemraisedItemClickand changed the selection on every release, while WinUI'sListViewBaseItemruns its tap interaction only when aTappedfollows, and a touch or pen hold is a right-tap. With this PR,UIElementrecognizers setSuppressesTapOnHold: a touch or pen hold (Holdingwas raised, or the press lasted longer thanHoldMinDelayMicroseconds) is never a tap or the first tap of a double-tap, and right-tap detection uses the same check. AListViewBaseItemskipsItemClickand selection on a touch or pen hold, whileListBoxItemandComboBoxItemstill select on a hold, as on WinUI.uno.cssturns off selection and the touch callout on#uno-root/#uno-body, but keeps them for hosted HTML and editable elements. Runtime tests cover holds onUIElement,Button,ListView/GridView(touch and pen),ListBoxandGestureRecognizer, and aListView_TouchHoldsample was added. The 7 touch cases that compile for WinUI also pass against native WinUI. Running them there needed two test-side fixes, both included here: aPointerDeviceTypealias for WinAppSDK (3b42ad6d3e) and update frames during injected WinUI holds (ccdfa80948). The tests added in review haven't been run against WinUI yet.Review follow-ups: only the release of the pointer that armed an item click can raise it, so a second finger's hold no longer raises
ItemClick. Every UIElement recognizer now treats a press as a hold once any of them raisedHoldingfor it. A parent with aContextFlyoutno longer lets aTapped-only child raiseTappedfor that press. ImplementingGestureFollowingis tracked in #25673.Behavior change⚠️
This aligns Uno with WinUI, but apps may notice it. On every Skia target, a touch or pen hold no longer raises
TappedorDoubleTapped, and aListView/GridViewitem no longer raisesItemClickor changes the selection when a hold ends. On WebAssembly, long-pressing the app no longer selects it or opens the touch callout (hosted HTML and editable elements keep both). To report holds as taps again, apps can setUno.WinRTFeatureConfiguration.GestureRecognizer.SuppressTapOnHold = falseat startup. That restoresTapped,ItemClickand selection on holds, but not the WebAssembly CSS. It's documented indoc/articles/feature-flags.md.PR Checklist ✅
Screenshots Compare Test Runresults.This is an automatic backport of pull request #25531 done by [Mergify](https://mergify.com).
This is an automatic backport of pull request #25790 done by [Mergify](https://mergify.com).