Repository navigation
fix(input): Prevent touch holds from raising taps and item clicks (backport #25531) - #25790
Conversation
|
Cherry-pick of 3e11bd3 has failed: Cherry-pick of 93cb47c has failed: Cherry-pick of bfdb0b8 has failed: Cherry-pick of b037cad has failed: Cherry-pick of b1c3e82 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
|
|
|
|
Resolved the cherry-pick conflicts Mergify committed, in one commit on top (06809b3). Mergify's commits are untouched. The conflicts came from master-only changes next to this PR's edits:
Two more fixes for names that only exist on master and that git couldn't flag:
Every other file matches the master PR's diff, at its 6.8 path. Local validation (macOS):
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25790/docs/index.html |
|
|
(cherry picked from commit 3e11bd3) # Conflicts: # src/Uno.UI/UI/Input/WinRT/GestureRecognizer.Gesture.cs # src/Uno.UI/UI/Input/WinRT/GestureRecognizer.cs
(cherry picked from commit 93cb47c) # Conflicts: # src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListBox.cs # src/Uno.UI/UI/Xaml/Controls/Primitives/SelectorItem.cs
(cherry picked from commit a5c73af)
(cherry picked from commit bfdb0b8) # Conflicts: # src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/ListView/ListView_TouchHold.xaml # src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/ListView/ListView_TouchHold.xaml.cs
(cherry picked from commit 2dc7455)
(cherry picked from commit a1f8017)
(cherry picked from commit 3c628e6)
(cherry picked from commit b037cad) # Conflicts: # doc/articles/feature-flags.md
(cherry picked from commit 3642922)
(cherry picked from commit c06c980)
(cherry picked from commit b1c3e82) # Conflicts: # src/Uno.UI/UI/Xaml/Controls/Primitives/SelectorItem.cs
(cherry picked from commit 5dcdb03)
(cherry picked from commit 052cdb2)
(cherry picked from commit 8b5b150)
06809b3 to
26a6237
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25790/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25790/docs/index.html |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
@Mergifyio backport release/stable/6.7 |
✅ Backports have been createdDetails
|
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).