mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-31 09:25:32 +08:00
fix(chat): prevent double send on mobile by removing redundant submit handlers (#719)
PromptInputSubmit already has type="submit" via the parent form, so the button's click triggers handleSubmit through the form's onSubmit path. The added onMouseDown/onTouchStart handlers created two extra paths that both invoked handleSubmit; on iOS Safari a single tap could fire both touchstart and a synthetic mousedown before isLoading state propagated, producing two messages and two image-upload roundtrips. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -401,14 +401,6 @@ export default function ChatComposer({
|
|||||||
<PromptInputSubmit
|
<PromptInputSubmit
|
||||||
disabled={!input.trim() || isLoading}
|
disabled={!input.trim() || isLoading}
|
||||||
className="h-10 w-10 sm:h-10 sm:w-10"
|
className="h-10 w-10 sm:h-10 sm:w-10"
|
||||||
onMouseDown={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
onSubmit(event as unknown as MouseEvent<HTMLButtonElement>);
|
|
||||||
}}
|
|
||||||
onTouchStart={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
onSubmit(event as unknown as TouchEvent<HTMLButtonElement>);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</PromptInputFooter>
|
</PromptInputFooter>
|
||||||
|
|||||||
Reference in New Issue
Block a user