[React Doctor] Added explicit type="button" to 19 non-submit buttons#431
Open
github-actions[bot] wants to merge 1 commit into
Open
[React Doctor] Added explicit type="button" to 19 non-submit buttons#431github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added explicit
type="button"to 19 non-submit buttons — prevents implicit-submit bugs in the 4 files that had bare<button>A
<button>without atypeattribute defaults totype="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 becometype="button".Changes
apps/e2e-app/src/App.tsx:59—button-has-type: nested-buttonapps/e2e-app/src/App.tsx:184—button-has-type: remove-elementapps/e2e-app/src/App.tsx:194—button-has-type: add-element-buttonapps/e2e-app/src/App.tsx:256—button-has-type: plain-buttonapps/e2e-app/src/App.tsx:394—button-has-type: dropdown-triggerapps/e2e-app/src/App.tsx:406—button-has-type: dropdown-item-1apps/e2e-app/src/App.tsx:412—button-has-type: dropdown-item-2apps/e2e-app/src/App.tsx:418—button-has-type: dropdown-item-3apps/e2e-app/src/App.tsx:462—button-has-type: modal-triggerapps/e2e-app/src/App.tsx:485—button-has-type: modal-inner-buttonapps/e2e-app/src/App.tsx:491—button-has-type: modal-close-buttonapps/e2e-app/src/App.tsx:549—button-has-type: pointerup-modal-triggerapps/e2e-app/src/App.tsx:569—button-has-type: pointerup-modal-inner-buttonapps/e2e-app/src/App.tsx:575—button-has-type: pointerup-modal-close-buttonapps/e2e-app/src/App.tsx:596—button-has-type: toggle-visibility-buttonapps/website/components/blocks/read-tool-call-block.tsx:38—button-has-type: streaming-chunk parameter click-feedback buttonpackages/react-grab/src/components/selection-label/completion-view.tsx:17—button-has-type:MoreOptionsButton(Solid<button>inside the Keep/Copied chip)packages/react-grab/src/components/selection-label/discard-prompt.tsx:60—button-has-type: discard-prompt "No" buttonpackages/react-grab/src/components/selection-label/discard-prompt.tsx:69—button-has-type: discard-prompt "Yes" buttonNote
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 websiteReadToolCallBlockparameter control and SolidMoreOptionsButton/ discard Yes / No buttons inpackages/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.
apps/e2e-app/src/App.tsx,apps/website/components/blocks/read-tool-call-block.tsx, andpackages/react-grabselection-label components.Written for commit a46f3e6. Summary will update on new commits.