remove selecting text on mobile

Signed-off-by: Shea <[email protected]>
This commit is contained in:
Shea committed 2026-06-16 03:06:16 +03:00
1 parent aa88750db7
commit a7657c81fa
4 files changed
+22 -2

No files matched your search

@@ -13,6 +13,7 @@ export const MessageBase = as<'div', css.MessageBaseVariants>(
collapse,
autoCollapse,
space,
mobile,
...props
},
ref
@@ -27,6 +28,7 @@ export const MessageBase = as<'div', css.MessageBaseVariants>(
collapse,
autoCollapse,
space,
mobile,
}),
className
)}
@@ -65,6 +65,15 @@ export const messageJumpHighlight = style({
animationIterationCount: 'infinite',
});
const MobileVariant = styleVariants({
true: {
WebkitUserSelect: 'none',
msUserSelect: 'none',
userSelect: 'none',
MozUserSelect: 'none',
},
});
const HighlightVariant = styleVariants({
true: [messageJumpHighlight],
});
@@ -124,6 +133,7 @@ export const MessageBase = recipe({
notifyHighlight: NotifyHighlightVariant,
selected: SelectedVariant,
isMarked: MarkedVariant,
mobile: MobileVariant,
},
defaultVariants: {
space: '400',
+6
View File
@@ -1029,6 +1029,12 @@ export function RoomTimeline({
timelineSync.setTimeline(getInitialTimeline(room));
scrollToBottom();
}}
style={{
WebkitUserSelect: 'none',
msUserSelect: 'none',
userSelect: 'none',
MozUserSelect: 'none',
}}
>
<Text size="L400">Jump to Latest</Text>
</Chip>
+4 -2
View File
@@ -890,7 +890,7 @@ function MessageInternal(
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (evt) => {
if (mobileOrTablet()) {
evt.preventDefault();
return;
setMobileOptionsOpen(true);
}
if (evt.altKey || !window.getSelection()?.isCollapsed || edit) return;
@@ -971,6 +971,7 @@ function MessageInternal(
notifyHighlight={highlightMentions ? notifyHighlight : undefined}
selected={!!menuAnchor || !!emojiBoardAnchor}
isMarked={isMarked}
mobile={mobileOrTablet()}
{...props}
{...hoverProps}
{...focusWithinProps}
@@ -1413,7 +1414,7 @@ export const Event = as<'div', EventProps>(
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (evt) => {
if (mobileOrTablet()) {
evt.preventDefault();
return;
setMobileOptionsOpen(true);
}
if (evt.altKey || !window.getSelection()?.isCollapsed) return;
@@ -1488,6 +1489,7 @@ export const Event = as<'div', EventProps>(
notifyHighlight={highlightMentions ? notifyHighlight : undefined}
selected={!!menuAnchor}
isMarked={isMarked}
mobile={mobileOrTablet()}
{...props}
{...hoverProps}
{...focusWithinProps}