fluid-project / hearth

A simple starter kit for the Laravel framework.
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Button type is not properly overridden #121

Closed greatislander closed 2 years ago

greatislander commented 2 years ago

Describe the bug

Supplying a type to the Button component does not override the default type (submit).

To reproduce

Steps to reproduce the behavior:

  1. Use the Button component with type="button".
  2. Inspect the rendered view.
  3. See that the button has type="submit".

Expected behavior

The button should have type="button".

Screenshots

Not applicable.

Technical details

Not applicable.

Additional context or notes

https://laravel.com/docs/9.x/blade#non-class-attribute-merging

greatislander commented 2 years ago

@chosww Maybe a good starting point for you would be taking a look at this ticket?

chosww commented 2 years ago

@greatislander Sounds good, I will take a look 👍

greatislander commented 2 years ago

@chosww One other aspect of this that would be good to include is tests for the component. Here's some information about testing components:

https://laravel.com/docs/9.x/http-tests#rendering-blade-and-components

The button tests should follow the pattern of the other tests for other components: https://github.com/fluid-project/hearth/tree/main/tests/Components

One last note, the repository uses Conventional Commits. Linking in case you haven't used them before.