Repository navigation
Conversation
|
The build 239912 found UI Test snapshots differences: Details
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
|
df9246c to
ccdfa80
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 240168 found UI Test snapshots differences: Details
|
|
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 240734 found UI Test snapshots differences: Details
|
|
|
Xiaoy312
left a comment
There was a problem hiding this comment.
LGTM. The fix matches WinUI, stays narrowly scoped, and the tests are good. I swept the OnTapped / Tapped += consumers in src/Uno.UI. The ones I checked (CalendarView items, ItemContainer, ToggleSwitch, SwipeItem, ScrollBar, RichEditBox, ComboBox) are WinUI ports, so a touch hold that no longer raises Tapped matches WinUI there too. The CI failure (Given_SkiaIOSAccessibilityElement.When_Shared_EventsSource_Changes_Then_All_Native_Aliases_Are_Invalidated on iOS) also fails on master and isn't related to this PR.
None of the following blocks the merge. They could be done here or in a follow-up:
-
_lastHeldPressis one static slot for the whole process. That's acceptable as a stopgap untilGestureFollowingexists, but:- When two fingers hold at the same time, the second overwrites the first. The first finger's release then falls back to the timestamp check, which is the case this record was added for.
- The unit test needs a "distinct" magic timestamp so the static state doesn't leak between tests.
Could it be kept per pointer? If not, please add a note on the field about this limitation.
-
The hold check differs depending on who asks.
Gesture.IsHeld()looks at that recognizer's own_holdingState, whileSelectorItemlooks at the shared static. Example: a parent listens only toTapped, and a child hasHoldingor aContextFlyout. If only the holding timer saw the hold, the child raisesHolding, and the parent still raisesTapped. HavingIsHeld()also callGestureRecognizer.IsHold(Down.Pointer, Down.Timestamp, up.Timestamp)would make both use the same signal. -
The comment on
IsHeld()gives the wrong reason. It says the timer can win "e.g. a busy UI thread". But the holding timer starts when the press is processed, so on a busy thread the timer is the less accurate clock and the timestamps are the reliable one. The real reason is that onceHoldinghas been raised,Tappedmust not follow, because the two are mutually exclusive. This also has a visible effect: under heavy jank, a tap shorter than 800 ms that gets a spuriousHoldingnow becomes a right-tap (the context menu opens) instead of a tap. -
Missing test case:
IsItemClickEnabled=falsewithSelectionMode=Single. This is the most common ListView setup. The code handles it (IsItemClickEnabledis also true whenSelectionMode != None), but none of the new data rows cover it. -
Behavior change worth a release note. On Skia mobile and WASM, apps stop receiving
ItemClickafter a long-press on aListView/GridViewitem. That's the correct WinUI behavior, but some apps may depend on the old one. -
PR description. It says the WinUI injection harness fixes are not included, but
3b42ad6d3eandccdfa80948are harness-side changes. Could you clarify which fixes were left out? -
Nits:
- In
SelectorItem.cs,using Uno.Foundation.Logging;comes afterWindows.Devices.Input. - The sample's
FontFamily="Consolas"doesn't exist on iPad and will fall back to another font.
- In
dr1rrb
left a comment
There was a problem hiding this comment.
➡️ Medium — 3 medium, 3 low, none blocking.
Approving: the fix matches WinUI. ListViewBaseItem only runs its touch tap interaction when a Tapped follows (ListViewBaseItem_Partial.cpp, OnPointerReleased), and the UIElement.Holding docs state that Tapped and Holding are mutually exclusive and that a completed touch hold is followed by RightTapped.
On top of the points already raised in the previous review:
GestureFollowingis the existing slot for what_lastHeldPressapproximates.- The change has no opt-out, and an opt-out would have to cover both the recognizer and
SelectorItem. - The hold helper waits on the wall clock.
The checklist ticks "Contains NO breaking changes", while touch and pen holds no longer raise Tapped, DoubleTapped, ItemClick or ListView selection, and the WASM host no longer allows text selection or the touch callout. Even as a WinUI alignment, it is worth unticking and stating in the description.
Suggested order:
- Carry the hold on
GestureFollowing(removes the static and its test workaround). - Add the opt-out on top of it, gating both paths.
- Replace the delays in the hold helper.
|
Thanks, Xiaoy312. Going through the list:
|
b173815 to
5cc1dfa
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25531/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241134 found UI Test snapshots differences: Details
|
|
|
5cc1dfa to
8b5b150
Compare
|
🤖 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-25531/docs/index.html |
|
The build 241526 found UI Test snapshots differences: Details
|
|
|
|
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. |
|
@mergify backport servicing/6.8 |
✅ Backports have been createdDetails
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 |
…r-25531 fix(input): Prevent touch holds from raising taps and item clicks (backport #25531)
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.