adobe / adobe/react-spectrum

RAC - MenuTrigger executed on press start, causing unexpected behaviour

Open
#5,350 3 comments 0 reactions 0 assignees View on GitHub
needs investigation RAC
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

The `MenuTrigger` component is executed on press start. If another element is rendered under the pointer on press end then it is triggered unintentionally.

### 🤔 Expected Behavior?

Releasing the pointer after launching the menu should not trigger other events on the page.

### 😯 Current Behavior

If another element is rendered under the pointer on press end then it is triggered unintentionally.

### 💁 Possible Solution

Change the behaviour so that `MenuTrigger` event is executed on press end. If it is essential to keep the current behaviour then press end events should be prevented during the same interaction.

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

https://codesandbox.io/s/elated-panini-gxzjnr?file=/src/App.js

This CodeSandbox demonstrates the issue. Clicking the button and then releasing immediately closes the menu.

### Version

"react-aria-components": "1.0.0-beta.2"

### What browsers are you seeing the problem on?

Chrome, Safari

### If other, please specify.

_No response_

### What operating system are you using?

macOS 12.6.5

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.