primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Tapping a Dropdown Trigger on mobile immediately closes the dropdown again

Open chris-farmact opened this issue 5 months ago • 1 comments

Bug report

When updating from @radix-ui/react-dropdown-menu 2.1.16 to 2.1.17 this bug appears. I suspect it has something to do with a change from onClick to onPointerDown, but coudn't find the root cause so far.

The problem is that apart from the menu immediately closing in my app, that the menu now opens on pointer down is really annoying, because when someone accidentally places their thumb on a dropdown trigger when scrolling, the menu immediately opens, because it doesn't differentiate between click and scroll anymore.

Current Behavior

Click: Image

Drag and release:

Image

Expected behavior

Click: Image

Drag and release:

Image

Reproducible example

StackBlitz Template

Suggested solution

Revert to the onClick behaviour of 2.1.16

Additional context

Issue is still present in 2.1.18, that button you see is an Ionic IonButton, the Trigger does not have the asChild prop

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-dropdown-menu 2.1.17
React n/a 19
Browser Chrome / Firefox Simulated mobile client with touch events!
Assistive tech
Node n/a
npm/yarn/pnpm
Operating System MacOS 15.7.4

chris-farmact avatar Jun 24 '26 10:06 chris-farmact

Update: closing this since this is an old issue: https://github.com/radix-ui/primitives/issues/1912

it just surfaced again because we patched 2.1.16 and the patch didn't get applied to the newer version.

chris-farmact avatar Jun 24 '26 11:06 chris-farmact