react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Virtual press fails to re-open Popover sometimes

Open staticshock opened this issue 1 year ago โ€ข 3 comments

Provide a general summary of the issue here

I'm using a trackpad with tap-to-click enabled. If I close and re-open a menu that looks like this, sometimes it requires two taps to re-open:

<MenuTrigger>
    <Button>Open menu</Button>
    <Popover>
      <Menu>
        <MenuItem id="hello">Hello</MenuItem>
      </Menu>
    </Popover>
  </MenuTrigger>

๐Ÿค” Expected Behavior?

One tap should close the menu, and the next one should consistently re-open it. (It appears to work correctly if I use a full click instead of a tap.)

๐Ÿ˜ฏ Current Behavior

Most of the times it works as expected, but sometimes (for me it's once every 10 taps or so, but this could be machine specific) it swallows a tap without re-opening the popover

๐Ÿ’ Possible Solution

๐Ÿคท

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

https://codesandbox.io/p/sandbox/ecstatic-keller-hcd3cf

Version

"react-aria-components": "1.1.1"

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

staticshock avatar Apr 15 '24 23:04 staticshock

Hmm I'm unable to reproduce on my mac. I'm on chrome v123 and running ventura on a m1 chip. Would you mind sharing more information about your device + chrome version?

yihuiliao avatar Apr 18 '24 00:04 yihuiliao

M1 mac w/ macOS Sonoma, Chrome 124.0.6367.61

staticshock avatar Apr 18 '24 04:04 staticshock

Here's a capture with keycaster:

https://github.com/adobe/react-spectrum/assets/13100/806950d8-00c5-46e0-b749-0b951be1328d

The first three pairs of taps successfully open/close the popover, then the 4th pair of taps demonstrates the issue.

staticshock avatar Apr 18 '24 04:04 staticshock