diff --git a/src/Uno.UI/Runtime/BrowserPointerInputSource.wasm.cs b/src/Uno.UI/Runtime/BrowserPointerInputSource.wasm.cs index 7079491e73be..d8da8eca14f4 100644 --- a/src/Uno.UI/Runtime/BrowserPointerInputSource.wasm.cs +++ b/src/Uno.UI/Runtime/BrowserPointerInputSource.wasm.cs @@ -122,6 +122,7 @@ private static int OnNativeEvent( case HtmlPointerEvent.pointerup: //case HtmlPointerEvent.lostpointercapture: // if pointer is captured, we don't get a up, just a capture lost (with skia for wasm) that.PointerReleased?.Invoke(that, args); + _PointerIdentifierPool.ReleaseManaged(pointerIdentifier); break; case HtmlPointerEvent.pointermove: @@ -147,6 +148,7 @@ private static int OnNativeEvent( case HtmlPointerEvent.pointercancel: that.PointerCancelled?.Invoke(that, args); + _PointerIdentifierPool.ReleaseManaged(pointerIdentifier); break; default: diff --git a/src/Uno.UI/UI/Xaml/Internal/InputManager.Pointers.cs b/src/Uno.UI/UI/Xaml/Internal/InputManager.Pointers.cs index 480fe884f2c7..ed5a0d5a505d 100644 --- a/src/Uno.UI/UI/Xaml/Internal/InputManager.Pointers.cs +++ b/src/Uno.UI/UI/Xaml/Internal/InputManager.Pointers.cs @@ -71,7 +71,7 @@ public PointerManager(InputManager inputManager) UIElement.PointerReleasedEvent, new PointerEventHandler((snd, args) => ProcessPointerUp(args, false)), handledEventsToo: true); -#if __WASM__ && !UNO_HAS_MANAGED_POINTERS +#if __WASM__ && !UNO_HAS_MANAGED_POINTERS // Managed pointer id is handled by the input source itself rootElement.AddHandler( UIElement.PointerCanceledEvent, new PointerEventHandler((snd, args) => ProcessPointerCancelled(args)), @@ -206,7 +206,7 @@ internal void ProcessPointerUp(PointerRoutedEventArgs args, bool isAfterHandledU ReleaseCaptures(args.Reset(canBubbleNatively: false)); -#if __WASM__ +#if __WASM__ && !UNO_HAS_MANAGED_POINTERS // Managed pointer id is handled by the input source itself PointerIdentifierPool.ReleaseManaged(args.Pointer.UniqueId); #endif @@ -216,7 +216,7 @@ internal void ProcessPointerUp(PointerRoutedEventArgs args, bool isAfterHandledU args.Handled = isAfterHandledUp; } -#if __WASM__ +#if __WASM__ && !UNO_HAS_MANAGED_POINTERS // Managed pointer id is handled by the input source itself private static void ProcessPointerCancelled(PointerRoutedEventArgs args) => PointerIdentifierPool.ReleaseManaged(args.Pointer.UniqueId); #endif