diff --git a/src/app/components/editor/MarkdownToolbar.tsx b/src/app/components/editor/MarkdownToolbar.tsx index ac0b7ce56..adda38c2f 100644 --- a/src/app/components/editor/MarkdownToolbar.tsx +++ b/src/app/components/editor/MarkdownToolbar.tsx @@ -242,7 +242,7 @@ function MarkdownToolbar() { return ( - + ('[data-message-swipe]'); const chatElement = target.closest('[data-chat-swipe]'); const ignoredElement = target.closest('[data-gestures="ignore"]'); + const scrollingElement = target.closest('[data-gestures="scroll"]'); const message = messageElement ? messageTargetsRef.current.get(messageElement) : undefined; const chat = chatElement ? chatTargetsRef.current.get(chatElement) : undefined; // Nested ignore markers (e.g. inline media) don't block swipe if they're part of // this message/chat's own surface, only if they sit outside it. - const blocked = + const blockedIgnored = ignoredElement !== null && !(messageElement && messageElement.contains(ignoredElement)) && !(chatElement && chatElement.contains(ignoredElement)); + // If the element is horizontally scrollable (scrollWidth > clientWidth), block gestures + const blockedScroll = + scrollingElement !== null && scrollingElement.scrollWidth > scrollingElement.clientWidth; + + const blocked = blockedScroll || blockedIgnored; + gestureRef.current = { startX: touch.clientX, startY: touch.clientY, diff --git a/src/app/components/url-preview/UrlPreviewCard.tsx b/src/app/components/url-preview/UrlPreviewCard.tsx index 130253605..d7bbc8b3e 100644 --- a/src/app/components/url-preview/UrlPreviewCard.tsx +++ b/src/app/components/url-preview/UrlPreviewCard.tsx @@ -432,7 +432,14 @@ export const UrlPreviewHolder = as<'div'>(({ children, ...props }, ref) => { ref={ref} style={{ marginTop: config.space.S200, position: 'relative' }} > - + {canScrollLeft && ( <> diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 06efa2f68..fbc7f028c 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -2052,7 +2052,13 @@ export const RoomInput = forwardRef( } > {uploadBoard && ( - + {Array.from(selectedFiles) .toReversed()