Skip to content
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

RFC: A nice set of form controls with a consistent api. #34

Closed
ghost opened this issue Feb 4, 2016 · 1 comment
Closed

RFC: A nice set of form controls with a consistent api. #34

ghost opened this issue Feb 4, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 4, 2016

I'd like to suggest a few [BREAKING] changes

Much of this is inspired by the work i've done with ember-form-for.

One component for every HTML5 input type

I'd like to add one component for each HTML5 input type, all these extend a common base input.
This is especially useful for the types: checkbox, radio, date, time, file.

A few examples:

  • The checkbox and radio type use the checked attribute.
  • date, time, datetime-local can have some magic added to transform Date objects into the correct string and back. See date-input in ember-form-for
  • The file type should pass the files.

It is possible to build all this into the {{one-way-input}} but IMO that would add a lot of complexity.
Also, there is the component helper, so instead of assigning the type attribute, you can use the component helper to pick the right type of input. Another pro is, that if you want a textarea or select, this would fall into the same algorithm, instead of having that be a special case.

The first positionalParam should be value, checked, selected, etc. depending on the type of control

That way you don't have to think about what property you have to set to get the desired effect, all components have the same consistent way of accepting the value.

Example:

{{one-way-input user.name}}
{{one-way-checkbox user.tosAccepted}}
{{one-way-select user.gender options="male female unknown"}}

Also

See: @rwjblue's comment in issue #28

Thoughts?

@ghost
Copy link
Author

ghost commented Apr 16, 2016

Closing as this is has mostly been implemented

@ghost ghost closed this as completed Apr 16, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants