Skip to content

[React Doctor] Added explicit type="button" to 19 non-submit buttons#431

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
react-doctor/2026-05-30/correctness-button-has-type
Open

[React Doctor] Added explicit type="button" to 19 non-submit buttons#431
github-actions[bot] wants to merge 1 commit into
mainfrom
react-doctor/2026-05-30/correctness-button-has-type

Conversation

@github-actions

@github-actions github-actions Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Added explicit type="button" to 19 non-submit buttons — prevents implicit-submit bugs in the 4 files that had bare <button>

A <button> without a type attribute defaults to type="submit". Inside a <form> that defaults causes an accidental form submission on the first click; outside a form the default is harmless but inconsistent — the lint rule fires anyway so the literal call site is correct. None of the 19 sites are intended form submitters (no <form> in any of these files), so all become type="button".

Changes



Note

Low Risk
Attribute-only markup fixes with no logic or API changes; low risk aside from negligible HTML semantics if a button were ever intended as submit inside a form.

Overview
Adds explicit type="button" to 19 <button> elements that previously relied on the HTML default (submit), across the e2e fixture app, website read-tool UI, and react-grab selection-label controls.

Most updates are in apps/e2e-app/src/App.tsx (nested, dynamic list, dropdown, modal, and visibility toggles). Smaller fixes cover the website ReadToolCallBlock parameter control and Solid MoreOptionsButton / discard Yes / No buttons in packages/react-grab. Behavior is unchanged for current layouts (no new forms); the change avoids accidental submit if these controls are ever wrapped in a <form>.

Reviewed by Cursor Bugbot for commit a46f3e6. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Add explicit type="button" to 19 non-submit buttons across the codebase. Prevents accidental form submits and resolves button-has-type lint warnings with no behavior changes.

  • Bug Fixes
    • Set type="button" on non-submit buttons.
    • Updated buttons in apps/e2e-app/src/App.tsx, apps/website/components/blocks/read-tool-call-block.tsx, and packages/react-grab selection-label components.

Written for commit a46f3e6. Summary will update on new commits.

Review in cubic

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-grab-storybook Ready Ready Preview, Comment May 30, 2026 3:46pm
react-grab-website Ready Ready Preview, Comment May 30, 2026 3:46pm

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

Labels

react-doctor Opened by react-doctor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants