-
Couldn't load subscription status.
- Fork 639
Description
Description
The Button component does not have a default type attribute. In e.g. react-bootstrap, the Button component by default has type set to button. Without such a default, the type will default to submit within forms, yielding the following warning when using e.g. Formik:
You submitted a Formik form using a button with an unspecified type attribute. Most browsers default button elements to type="submit". If this is not a submit button, please add type="button".
As it is normal to add multiple buttons within a form, it seems safer and more intuitive to have a default type set to button, and then explicitly specify which button to use for submission.
Steps to reproduce
- Create page with the following form:
<form>
<Button type="submit">Submit</Button>
<Button>Recalculate<Button>
</form>
- The second button will default to
type=submitinstead oftype=button. Expected behavior would be that the secondButtontype would default tobutton.
Version
v35.2.0
Browser
Firefox