Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buttons now have type button by default #2103

Open
wants to merge 1 commit into
base: v1.x-2022-07
Choose a base branch
from

Conversation

lordofthecactus
Copy link
Contributor

Description

Our buttons use the default browser type which is html. This change makes type button the default.

In react we usually have click handlers instead of relying in default html form submissions which force the page to re-render.

Reasons we should do this:

  1. Having this default button type improves dx
  2. No writing type=button on all buttons
  3. Most UI libraries (e.g. Chakra UI, MUI) use this as their default as well.

Reason not to do this:

  1. Defaults of browser are good enough and we should stick to them to improve our non-javascript code. e.g. form submissions without click handlers

Thoughts?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2022

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run "yarn changeset add" to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.

Copy link
Contributor

@frehner frehner left a comment

Choose a reason for hiding this comment

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

  • Technically a breaking change, though a small one.
  • Needs a changeset added, with a migration guide
  • Documentation for each button should be updated to reflect that this is now the default

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.

None yet

2 participants