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

add :init param to INPUT, SELECT and TEXTAREA tags #112

Closed
catmando opened this issue Jan 25, 2019 · 1 comment
Closed

add :init param to INPUT, SELECT and TEXTAREA tags #112

catmando opened this issue Jan 25, 2019 · 1 comment
Labels
enhancement New feature or request ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch
Milestone

Comments

@catmando
Copy link
Contributor

catmando commented Jan 25, 2019

internally will change to defaultValue or defaultChecked

          INPUT(type: :checkbox, init: true)
          INPUT(type: :radio, init: true)
          INPUT(type: :radio, init: false)
          SELECT(init: 'some value') do ...
          INPUT(type: :text, init: 'some value') 
          INPUT(init: 'some value') # same as type: :text
          TEXTAREA(init: 'some value')

Together with #111 this makes uncontrolled inputs quite a bit more succinct:

    name = INPUT(type: :text, init: some_model_for_example.name)
    BUTTON { 'save' }.on(:click) { some_model_for_example.update name: jq[name].value }
catmando added a commit that referenced this issue Jan 26, 2019
@catmando catmando added the enhancement New feature or request label Jan 26, 2019
@catmando catmando added this to the alpha1.4 milestone Jan 26, 2019
@Tim-Blokdijk
Copy link
Contributor

Seems to work!
https://hyperstack.org/edge/docs/tutorials/todo still documents the defaultValue way of doing it.

@catmando catmando modified the milestones: alpha1.4, alpha1.5 Apr 18, 2019
@catmando catmando added the ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch label Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch
Projects
None yet
Development

No branches or pull requests

2 participants