Protoss78 / paper-button-group

A clone of paper-radio-group, using paper-buttons instead.
https://www.webcomponents.org/preview/Protoss78/paper-button-group
6 stars 5 forks source link

Support for iron-form #4

Open rjcorwin opened 7 years ago

rjcorwin commented 7 years ago

Hi there - Great component. I would love to use this in forms, specifically iron-form.

Protoss78 commented 7 years ago

Hi. Thanks for the feedback. I have not tried that combination yet. Can you describe what behavior you would expect their? A PR related to that is welcome any time. :-)

rjcorwin commented 7 years ago

The iron-form element (https://github.com/PolymerElements/iron-form) is used to encapsulate standard HTML forms to support non-native form elements. This is necessary because the form element is very stubborn about what elements it will pay attention to. paper-button-group would be a great alternative to the paper-radio-group element so you could for example do...

<iron-form>
  <form>
    <paper-button-group name="shirt-size" value="small">
      <paper-button value="small">Small</paper-radio-button>
      <paper-button value="medium">Medium</paper-radio-button>
      <paper-button value="large">Large</paper-radio-button>
    </paper-button-group>
  </form>
</iron-form>

The above example of an API follows my suggestion for an API proposed for the paper-radio-group https://github.com/PolymerElements/paper-radio-group/issues/86.