Skip to content

Allow to set ButtonComponent type

Thomas Hutterer requested to merge submit_buttoncomponent into master

What does this MR do and why?

This makes it possible to set the type attribute directly on the ButtonComponent:

= render ButtonComponent.new(type: :submit)

Before you had to set it as part of the button_options but this approach turned out to be not intuitive and error prone.

How to set up and validate locally

  • The component is very new and only used in a few places. See its initial MR for examples and review instructions.
  • Change one such usage to read ButtonComponent.new(type: :submit) ..... The rendered button now should have type="submit" instead of "button".

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Hutterer

Merge request reports