diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs index 8ef2a569f662..9964e8e2e85a 100644 --- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs +++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ListViewBase.cs @@ -4654,7 +4654,6 @@ public async Task When_UpdateLayout_In_DragDropping() Content = new TextBlock { AllowDrop = true, - CanDrag = true, Height = 100, Text = i.ToString() } diff --git a/src/Uno.UI/UI/Input/GestureRecognizer.Manipulation.cs b/src/Uno.UI/UI/Input/GestureRecognizer.Manipulation.cs index c67dffc1f6ab..29813e861dcb 100644 --- a/src/Uno.UI/UI/Input/GestureRecognizer.Manipulation.cs +++ b/src/Uno.UI/UI/Input/GestureRecognizer.Manipulation.cs @@ -80,6 +80,7 @@ private enum ManipulationState public bool IsTranslateYEnabled => _isTranslateYEnabled; public bool IsRotateEnabled => _isRotateEnabled; public bool IsScaleEnabled => _isScaleEnabled; + public bool IsDraggingEnabled => _isDraggingEnable; internal static void AddPointer(GestureRecognizer recognizer, PointerPoint pointer) { diff --git a/src/Uno.UI/UI/Input/GestureRecognizer.cs b/src/Uno.UI/UI/Input/GestureRecognizer.cs index 005363537565..21e15e9200f4 100644 --- a/src/Uno.UI/UI/Input/GestureRecognizer.cs +++ b/src/Uno.UI/UI/Input/GestureRecognizer.cs @@ -201,12 +201,19 @@ internal GestureSettings PreventEvents(PointerIdentifier pointerId, GestureSetti _manipulation?.DisableDragging(); } + var ret = GestureSettings.None; if (_gestures.TryGetValue(pointerId.Id, out var gesture)) { gesture.PreventGestures(events); + ret |= gesture.Settings; } - return _gestureSettings; + if (_manipulation is not null && _manipulation.IsActive(pointerId) && _manipulation.IsDraggingEnabled) + { + ret |= GestureSettings.Drag; + } + + return ret; } #region Manipulations diff --git a/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs b/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs index d18d8d433799..198702b57468 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.Pointers.cs @@ -909,7 +909,11 @@ partial void PrepareManagedPointerEventBubbling(RoutedEvent routedEvent, ref Rou // ptArgs.Pointer.IsInRange && ptArgs.IsPointCoordinatesOver(this) (and probably share it on all platforms). var isOver = ptArgs.Pointer.IsInRange && (ptArgs.Pointer.PointerDeviceType, ptArgs.Pointer.IsInContact) switch { +#if HAS_UNO_WINUI (global::Microsoft.UI.Input.PointerDeviceType.Touch, false) => false, +#else + (PointerDeviceType.Touch, false) => false, +#endif _ => ptArgs.IsPointCoordinatesOver(this), }; #endif