fix: suppress native iOS callout on mobile long-press

Add -webkit-touch-callout: none on mobile viewports to prevent the
native iOS copy/lookup popup from racing with our context menu.
Clear any text selection when the long-press timer fires.
This commit is contained in:
Jannis Braun
2026-03-23 15:26:09 +01:00
parent ce33d8f7ea
commit fd6be8c713
2 changed files with 11 additions and 0 deletions
@@ -560,6 +560,8 @@ function useGlobalLongPress(isMobile: boolean) {
timer = setTimeout(() => {
timer = null;
fired = true;
// Clear any native text selection that started during the hold
window.getSelection()?.removeAllRanges();
// Dispatch synthetic contextmenu on the original target.
// React's event delegation picks it up and fires onContextMenu handlers.
const syntheticEvent = new MouseEvent('contextmenu', {