New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Builder: Add 'value' option to non-component fields #387

Closed
c-frater opened this Issue Mar 6, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@c-frater
Copy link
Contributor

c-frater commented Mar 6, 2017

Context

When setting up a hx.Form it is currently not possible to initialise with a value for checkboxes etc. that don't have an underlying hexagon component.
The question is whether it should let you initialise with a value or is using hx.Form::data the correct way to initialise value(s)?

Expected Behavior

It should be possible to initialise all form builder fields with a value (i.e. in the addType method)

Actual Behavior

It is not possible for some fields to be initialised with a value, instead forcing the use of hx.Form::data after the form has been created which isn't as nice.

Workaround

const form = hx.Form(selector)
  .addCheckbox('Checkbox')

form.data({
  Checkbox: true
})

Your Environment

  • Hexagon Version: 1.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment