Skip to content

<Button> type attribute should default to 'submit', not 'button' #382

@mikeatlas

Description

@mikeatlas

Per this recent commit last night ebbeba7 by @TheSharpieOne ...

This caused a regression preventing us from logging into our own application. We were using a single <Button> element within a form for a login page, and the default behavior for a button in a form is submit.

Once this change went in, our form stopped ... submitting! Changing our button to type='submit' does indeed fix things, but this is different from the HTML5 button spec:

type
The type of the button. Possible values are:
submit: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is dynamically changed to an empty or invalid value.

I realize Button in reactstrap vs button in HTML5 are not the same, but it would be advisable to align with the HTM5 spec in this case.

h/t @j-francisco (thanks!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions