microsoft / microsoft/react-native-windows

Pointer capture is broken in Popup content in XAML Islands

Open
#11,823 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Flyout Area: Islands Area: Mouse bug Needs WinUI 3 Partner: Facebook Workstream: Component Parity
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

This bug probably belongs in microsoft/microsoft-ui-xaml, but there seems to be an issue with native pointer capture in TouchEventHandler when dealing with popup content (either PopupViewManager or FlyoutViewManager) when running in the context of a XAML Islands app.

Steps To Reproduce
  1. Open RNTester in playground-win32.sln
  2. Open the Flyout example
  3. Click left-button down and hold on some button in the Flyout
  4. Drag outside of the Flyout
  5. Release the pointer
  6. Immediately try to press another button in the flyout
  7. Observe debug assert failure because a previous pointer sequence was not closed out
Expected Results

The debug assert should not occur.

The reason the assertion failure occurs is because we never receive any kind of OnPointerConcluded event (released, capture lost, canceled, etc.).

I tried a few things, like saying "if we can't have pointer capture, let's just always cancel the gesture sequence OnPointerExit", but unfortunately, PointerExited also does not fire in XAML Islands for pointers in Flyout or Popup components.

I'm not sure what the right mitigation is. I'm guessing this is not something that would be a candidate for a patch release, and even still it impacts users who have not upgraded their OS.

CLI version

npx react-native -v

Environment
npx react-native info
Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure from RNTester in playground-win32.sln using the Flyout example. Read TouchEventHandler together with PopupViewManager and FlyoutViewManager to trace pointer capture and conclusion events in XAML Islands. Done means the described drag-and-release sequence no longer leaves the pointer sequence open or triggers the debug assert.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.