googlearchive / paper-radio-group

A group of radio buttons
6 stars 1 forks source link

Checked radio buttons are never unchecked #12

Open robdodson opened 9 years ago

robdodson commented 9 years ago

If you set a paper-radio-button to checked then click a sibling radio button, the first checked item does not uncheck.

<paper-radio-group>
  <paper-radio-button></paper-radio-button>
  <paper-radio-button checked></paper-radio-button>
  <paper-radio-button></paper-radio-button>
</paper-radio-group>

ex: http://jsbin.com/nigixoqamo/1/edit

Doing the same with regular radio buttons in a group will uncheck the explicitly checked item

<input type="radio" name="foo">
<input type="radio" checked name="foo">
<input type="radio" name="foo">

http://jsbin.com/raruyadiku/2/edit

I know that you can set selected on the paper-radio-group but it seems like the above use case should be supported as well.

cc @m1ket

ebidel commented 9 years ago

Running into this too for the Google I/O site.

dkokic commented 9 years ago

Any progress on this issue? It looks like the examples at http://dart-lang.github.io/polymer-core-and-paper-examples/build/web/paper_demos.html#paper-radio-button are working just fine. While the following example is okay:

<paper-radio-group selected="2">
    <paper-radio-button label="Always"></paper-radio-button><br>
    <paper-radio-button label="Only when plugged in"></paper-radio-button><br>
    <paper-radio-button label="Never"></paper-radio-button>
</paper-radio-group>

the code snippet below is behaving like described in title.

<paper-radio-group id="login-type" selected="{{login_type}}">
    <template repeat="{{key in login_type_label.keys}}">
        <paper-radio-button name="{{key}}" label="{{login_type_label[key]}}"></paper-radio-button><br>
    </template>
</paper-radio-group>

Thanks in advance for any comments

dkokic commented 9 years ago

After some debugging I found out that my problem was solved by making the login_type observable (as it is used somewhere else in the template). I would still like to know why is it causing the radio button group to fail deselecting other radio buttons.