petalframework / petal_components

Phoenix + Live View HEEX Components
https://petal.build/components
MIT License
818 stars 94 forks source link

Add `type=button` to close slide over button #246

Closed tegon closed 1 year ago

tegon commented 1 year ago

Ideally button elements should always specify a type attribute to avoid unexpected behavior, since each browser might implement a different default.

In our app, we do HTML forms inside slide overs. When the user clicks to close a slide over, the form ends up being submitted, given that the close button is inside the form. Setting the button's type prevents this issue.

nhobes commented 1 year ago

Thanks for this!