mui / mui/base-ui

[context menu] `ContextMenuTrigger` long-press doesn't fire for stylus input

Open
#4,854 2 comments 0 reactions 1 assignee Claimed by @flaviendelangle View on GitHub
component: context menu type: bug
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

Hi! `ContextMenuTrigger`'s long-press path uses TouchEvents (`onTouchStart`/`Move`/`End`/`Cancel`), so it doesn't fire for stylus input. Apple Pencil on iOS Safari dispatches PointerEvents only, and most Surface pen and Wacom-style tablet setups are pointer-primary too. Would you consider switching to PointerEvents filtered to `pointerType === 'touch' || pointerType === 'pen'`? The 500ms timer, 10px movement tolerance, and cancellation logic would all carry over unchanged for finger touch, and stylus users would get the same long-press UX.

Happy to send a PR if you'd accept it.

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.