fix: prevent native text selection on mobile long-press
iOS triggered both the app context menu and native text selection overlay on long-press. Three-layer fix: CSS user-select:none on buttons/[role=button]/ [data-context-menu] elements; non-passive touchstart listener with conditional preventDefault on context-menu targets; removeAllRanges() at timer fire to clear any residual selection. Added data-context-menu to all mobile surfaces that use onContextMenu handlers.
This commit is contained in:
@@ -165,6 +165,7 @@ export function MobileDmsScreen() {
|
||||
return (
|
||||
<button
|
||||
key={dm.id}
|
||||
data-context-menu
|
||||
onClick={() => handleDmTap(dm.id)}
|
||||
onContextMenu={(e) => handleDmContextMenu(e, dm.id, isGroup)}
|
||||
className="w-full flex items-center gap-3 px-4 py-3 hover:bg-interactive-hover text-left transition-colors"
|
||||
|
||||
Reference in New Issue
Block a user