fix(dashboard): block composer drag-pan via onTouchMove preventDefault

touch-action: manipulation is needed on the textarea so iOS registers
first-tap focus reliably, but it also allows pan-y — which let the
user drag the input box up off-screen with the keyboard up.
Cancelling touchmove blocks the drag without affecting tap (a tap
fires touchstart + touchend with no touchmove in between), so the
composer stays locked AND first-tap focus works.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-06 21:51:40 -07:00
parent 5caaabcdba
commit 2bc7aa0151

View File

@@ -1948,6 +1948,16 @@ export function ChatView({ projectId, addToast }: ChatViewProps) {
event.preventDefault();
event.currentTarget.focus({ preventScroll: true });
}}
onTouchMove={(event) => {
// Lock the composer in place. touch-action: manipulation
// is required for first-tap focus to register on iOS,
// but it also permits pan-y, which lets the user drag
// the input box up off-screen. Cancelling touchmove
// blocks the drag without affecting tap (a tap fires
// touchstart + touchend with no touchmove in between).
if (typeof window === "undefined" || window.innerWidth > 768) return;
event.preventDefault();
}}
rows={1}
data-testid="chat-input"
/>