Skip to content

fix(chat): correct button type to buttons in web chat#1446

Open
HynoR wants to merge 1 commit intoMoonshotAI:mainfrom
HynoR:fix/web-2
Open

fix(chat): correct button type to buttons in web chat#1446
HynoR wants to merge 1 commit intoMoonshotAI:mainfrom
HynoR:fix/web-2

Conversation

@HynoR
Copy link

@HynoR HynoR commented Mar 16, 2026

Related Issue

Resolve #1428

Description

add button type in each button like element to avoid global submit when clicking file upload button.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Copilot AI review requested due to automatic review settings March 16, 2026 03:22
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an issue in the web chat composer where clicking non-submit controls (notably the attachment button) could trigger an unintended form submit, causing the current prompt text to be sent.

Changes:

  • Add type="button" to the attachment button in GlobalConfigControls to prevent implicit form submission.
  • Add type="button" to other Button-based controls in the same toolbar (model selector trigger, restart busy sessions, reload config) to ensure consistent non-submit behavior inside the prompt <form>.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants