-
Notifications
You must be signed in to change notification settings - Fork 526
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
feat(Button): add default type #2807
Conversation
🦋 Changeset detectedLatest commit: a5be8b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this is a breaking change potentially?
@langermank I think if someone relies on inferred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Regarding moving this to ButtonBase
instead: I don't think it's necessary because ButtonBase
is only used elsewhere in LinkButton
(which renders as an a
tag) and some deprecated components.
This is theoretically a breaking change but I've personally never seen anyone rely on the implicit submit
type of a button. I'd be surprised if this is done anywhere.
I think we can try this out in the upcoming release and see how it lands, happy to revert it back if it becomes problematic! |
I go 50/50 on this, but agreed with feeling it out I always think html is weird here by defaulting type to submit in forms, but also that consistency with html is nice (even though it's non-intuitive) |
Closes #2806
Update the default type for
Button
to be"button"
. By default, buttons are inferred to be oftype="submit"
which can cause some unexpected behavior, especially within forms.Changelog
New
Changed
type="button"
toButton.tsx
Removed