mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
remove selecting text on mobile
Signed-off-by: Shea <[email protected]>
This commit is contained in:
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',
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user