Skip to content

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

Closed
@catmando

Description

@catmando

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 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-to-releaseInternal Use Only: Has been fixed, specs passing and pushed to edge branch

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions