Skip to content

Commit 480fcca

Browse files
committed
fix: prevent attachment button click from triggering form submit
The Paperclip (attach files) button in GlobalConfigControls is rendered inside the prompt form without an explicit type attribute. Since the default button type in a form is 'submit', clicking it triggers a form submission in addition to opening the file dialog. Add type="button" to prevent the implicit form submit. Fixes #1428
1 parent 7ba9695 commit 480fcca

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

web/src/features/chat/global-config-controls.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ export function GlobalConfigControls({
205205
<Button
206206
variant="ghost"
207207
size="icon"
208+
type="button"
208209
className="size-9 border-0"
209210
aria-label="Attach files"
210211
onClick={() => attachments.openFileDialog()}

0 commit comments

Comments
 (0)