Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Checked radio buttons are never unchecked #12

Open
robdodson opened this issue Apr 2, 2015 · 3 comments
Open

Checked radio buttons are never unchecked #12

robdodson opened this issue Apr 2, 2015 · 3 comments

Comments

@robdodson
Copy link
Contributor

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
Copy link
Contributor

ebidel commented Apr 3, 2015

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

@dkokic
Copy link

dkokic commented May 16, 2015

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
Copy link

dkokic commented May 16, 2015

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants