wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
90 stars 16 forks source link

Forms/Input does not work properly, doesn't attach attributes #222

Open doxigo opened 1 year ago

doxigo commented 1 year ago

Describe the bug Looking at the _input.twig file and the forms.wingsuit.yml file, there seems to be some errors, the online demo also has the issue as well

the attributes section doesn't really get filled with placeholder, type and possibly value correctly.

If you inspect the checkbox or submit, for instance, you don't see the "type" there

Screenshot 2022-12-09 at 16 11 41

We can fix this by using .setAttribute('type', variant) and using fields for placeholder and value like so:

{% set attributes = attributes.addClass(classes)
.setAttribute('type', variant)
.setAttribute('placeholder', placeholder)
.setAttribute('value', default_input)
 %}

but I wonder if there's a better way to tackle this? ie. using settings as intended

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Forms/Inputs/Checkbox'

Expected behavior Proper support of placeholder, type and possibly value

Also a side note I wonder if there's an easy way to access the settings values in twig? couldn't find any documentations on that