googlearchive / paper-radio-group

A group of radio buttons
6 stars 4 forks source link

Value not clearing for paper-radio-buttons with toggle set to true #10

Open sudsy opened 9 years ago

sudsy commented 9 years ago

Hi!

I have the following paper-radio-group:

<paper-radio-group horizontal layout selected="{{lineItem.commission}}">
            <paper-radio-button class="ten" name="ten" toggles></paper-radio-button>
            <paper-radio-button class="twenty" name="twenty" toggles></paper-radio-button>
</paper-radio-group>

This works as expected updating the commission property of the lineItem object when the user selects either of the radio buttons.

If the user then toggles the selected item back to deselected so that buth items are unselected, the commission property of the lineItem object retains the last setting it had prior to deselection.

frankiefu commented 9 years ago

This is probably related to https://github.com/Polymer/core-selector/issues/23

But in general radio group allows only one value in a group be selected, and does not allow toggling off individual radio. This is true in native HTML input type="radio" too.

sudsy commented 9 years ago

I am wondering if it really is related to that core-selector issue. In my reading of it, it seems to be a ui issue rather than a model issue.

I guess the problem in my case is that the model is not reflecting the ui. The ui permits all radio buttons to be deselected, but the model is not reflecting that.

It seems to me that there are 2 possible courses of action:

  1. Make the model reflect what is going on in the ui
  2. Override the behaviour in the ui so that items cannot be deselected in a radio group even if they have the toggles option set.

There's an interesting discussion about whether one item should always be selected and how this relates to the standard here

ebidel commented 9 years ago

Running into this too for the I/O site.