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:
@@ -1948,6 +1948,16 @@ export function ChatView({ projectId, addToast }: ChatViewProps) {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.currentTarget.focus({ preventScroll: true });
|
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}
|
rows={1}
|
||||||
data-testid="chat-input"
|
data-testid="chat-input"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user