Skip to content

isVirtualPointerEvent false positive for Firefox with trackpad and tap-to-click on macOS #10184

@pierreburel

Description

@pierreburel

Provide a general summary of the issue here

On Firefox macOS, tapping with an external Magic Trackpad with tap-to-click enabled does not trigger press events on interactive components (Checkbox, Button, etc.). With the internal trackpad, press events are inconsistent as well.

🤔 Expected Behavior?

Tapping with an internal or external trackpad should always trigger press events.

😯 Current Behavior

Tapping with an external trackpad never trigger the press event. Tapping with the internal trackpad is inconsistent and sometimes don't trigger the press event.

See "steps to reproduce" below.

💁 Possible Solution

Not sure, but in https://github.com/adobe/react-spectrum/blob/main/packages/react-aria/src/utils/isVirtualEvent.ts#L42-L57, adding isAndroid() or maybe !isMac() to the second condition might fix this.

export function isVirtualPointerEvent(event: PointerEvent): boolean {
  return (
    (!isAndroid() && event.width === 0 && event.height === 0) ||
-   (event.width === 1 &&
+   (isAndroid() &&
+    event.width === 1 &&
     event.height === 1 &&
     event.pressure === 0 &&
     event.detail === 0 &&
     event.pointerType === 'mouse')
  );
}

🔦 Context

We're building a widget encapsulated within shadow DOM and had to update RAC to use enableShadowDOM from @react-stately/flags and discovered this very niche regression.

🖥️ Steps to Reproduce

  1. Open https://codesandbox.io/p/sandbox/m7zlnn in Firefox on macOS
  2. Use external trackpad with tap-to-click enabled
  3. Tap the checkbox: nothing happens, event log only shows onPointerDown (pressure: 0)
  4. Physical click works; internal trackpad (kinda) works; other browsers work

Version

1.18.0

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

macOS 26.5.1

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingusePresswaitingWaiting on Issue Author

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions