adobe / adobe/react-spectrum

Pointerdown event doesn't fire on Safari after drag event

Open
#2,322 3 comments 0 reactions 0 assignees View on GitHub
browser bug
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

# 📝 Feedback

There is a bug in Safari where after a drag the pointerdown event doesnt fire on the first click https://bugs.webkit.org/show_bug.cgi?id=202287. I have provided an example where this behavior can be reproduced with react-dnd. Since dnd is in the works for react-aria I thought I would bring this issue up. Not sure if this was encountered during development.

The result in react aria because of this is that anything using usePress is requiring 2 clicks to fire when using the drag and drop api.

Right now I've made a check for myself but I'm not sure how dangerous this is(Since usePress is checking for PointerEvent being defined).

```
if (isMACOS) {
window.PointerEvent = undefined;
}
```

Maybe react-aria needs a global flag that can be set to prevent using PointerEvents? What do you guys think is the goto solution for this?

## 🔦 Context

## 💻 Code Sample

https://codesandbox.io/s/tender-volhard-g5f6j

## 🌍 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| [Package name] |
| Browser |
| Operating System |

## 🧢 Your Company/Team

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.