Skip to content

Fix/issue 3887 button types#3904

Open
pradeep0153 wants to merge 24 commits into
Premshaw23:masterfrom
pradeep0153:fix/issue-3887-button-types
Open

Fix/issue 3887 button types#3904
pradeep0153 wants to merge 24 commits into
Premshaw23:masterfrom
pradeep0153:fix/issue-3887-button-types

Conversation

@pradeep0153

Copy link
Copy Markdown
Contributor

Closes #3887.

Description

This PR resolves a semantic HTML issue that frequently leads to unpredictable interface behavior by ensuring all standalone <button> tags specify an explicit type attribute.

Changes Made

  • Scanned the React UI components for all <button> elements missing a type declaration.
  • Added type="button" to buttons that are strictly meant for triggering JavaScript interactions (like opening modals, toggling menus, or expanding accordions) rather than submitting forms.

Impact

  • Bug Prevention: According to the HTML5 specification, any <button> element rendered inside a <form> without a specified type defaults to type="submit". By explicitly setting type="button", we eliminate the risk of accidental page reloads or unintended, premature form submissions when a user clicks a secondary action like "Cancel" or "Close".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A11y: Add explicit type="button" attributes to <button> elements

1 participant