adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.88k stars 1.12k forks source link

Drag-and-drop broken on Chrome for Android #7159

Open staticshock opened 2 weeks ago

staticshock commented 2 weeks ago

Provide a general summary of the issue here

It seems to me that drag and drop is generally broken on Chrome for Android, possibly due to recent changes to browser behavior?

In my code, and also in the code sandbox shared below, a long press (on Chrome for Android) triggers isDragging on the correct item, but the DragPreview never renders, and no drags can be completed.

Is RAC's DnD implementation no longer working in the latest version of mobile Chrome, or am I missing something obvious? Is my example code broken? If so, how?

๐Ÿค” Expected Behavior?

DnD example works in Chrome for Android as it does on Safari for iOS

๐Ÿ˜ฏ Current Behavior

DnD example does not work in Chrome for Android.

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

https://codesandbox.io/p/sandbox/hungry-kepler-6frk9l

Version

RAC 1.3.2

What browsers are you seeing the problem on?

Other

If other, please specify.

Specifically Chrome for Android (and possibly iOS)

What operating system are you using?

Android

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

LFDanLu commented 1 week ago

What version of Chrome 129 are you on and what kind of Android device? Your code sandbox works for me, I see the drag preview and can reorder properly on my Android phone. I'm using Chrome 129.0.6668.81, Android 14, Galaxy S22+

staticshock commented 1 week ago

I'm on Chrome 129.0.6668.81 as well. Android 14, Pixel 6.

staticshock commented 1 week ago

https://github.com/user-attachments/assets/c11b80bd-b5f7-4ec4-8ca8-5fe51c05584e

Here's a screen recording of what I'm seeing. Sorry, the pointer is not part of the video.

LFDanLu commented 1 week ago

Super bizarre, here is a recording from my phone for reference:

https://github.com/user-attachments/assets/b07bddb1-eaf4-48de-9786-7b7141fa560e

I did just find this bug filed against Chromium: https://issues.chromium.org/issues/363930156, does their minimal reproduction example work for you?

staticshock commented 1 week ago

Oh, great find. Yeah, I think this is exactly what I'm running into. I can reproduce it reliably on my device using their demo.

LFDanLu commented 1 week ago

Great, thanks for letting us know about this! We'll have to see if a workaround is possible, but we might have to wait on Chrome for this one unfortunately. I'll leave this open for visibility though

staticshock commented 1 week ago

Happy to workshop or test solutions if you decide to fix this within React Aria