From b1e5755c1401a895bcafb25b4a84df1f22076bcc Mon Sep 17 00:00:00 2001 From: jasonlaguidice <19523621+jasonlaguidice@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:57:55 -0800 Subject: [PATCH] Add tap & hold for scheduled send instead of chevron for isMobileOrTablet() --- src/app/features/room/RoomInput.tsx | 33 +++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index e8e71606..83d5b9e6 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -210,6 +210,8 @@ export const RoomInput = forwardRef( selectedFiles.map((f) => f.file) ); const uploadBoardHandlers = useRef(); + const longPressTimer = useRef | null>(null); + const isLongPress = useRef(false); const imagePackRooms: Room[] = useImagePackRooms(roomId, roomToParents); @@ -943,8 +945,35 @@ export const RoomInput = forwardRef( /> { + if (isLongPress.current) { + isLongPress.current = false; + return; + } + submit(); + }} onMouseDown={(e: MouseEvent) => e.preventDefault()} + onPointerDown={() => { + isLongPress.current = false; + if (mobileOrTablet() && delayedEventsSupported) { + longPressTimer.current = setTimeout(() => { + isLongPress.current = true; + setShowSchedulePicker(true); + }, 1000); + } + }} + onPointerUp={() => { + if (longPressTimer.current !== null) { + clearTimeout(longPressTimer.current); + longPressTimer.current = null; + } + }} + onPointerCancel={() => { + if (longPressTimer.current !== null) { + clearTimeout(longPressTimer.current); + longPressTimer.current = null; + } + }} variant={scheduledTime ? 'Primary' : 'SurfaceVariant'} size="300" radii="0" @@ -952,7 +981,7 @@ export const RoomInput = forwardRef( > - {delayedEventsSupported && ( + {delayedEventsSupported && !mobileOrTablet() && ( ) => { setScheduleMenuAnchor(evt.currentTarget.getBoundingClientRect());