Sending old value when wrapped in Template
Closed this issue · 1 comments
When the on-tap function is fired, it captures and logs the previous value. So if {{item.authd}} = 'authnr' it's radio button is highlighted however when another button is tapped the e.currentTarget.selected displays the older value, not the tapped
<template is="dom-repeat" items="{{data}}">
<paper-radio-group selected="{{item.authd}}" on-tap="authChanged" id="{{item.id}}">
<paper-radio-button name="authnr">N/R</paper-radio-button>
<paper-radio-button name="pending">Pending</paper-radio-button>
<paper-radio-button name="authd">Auth</paper-radio-button>
</paper-radio-group>
</template>
...
authChanged: function(e, name) {
console.log(e.currentTarget.selected)
}
This is working as intended. Tap
is fired before the paper-radio-group
got a chance to change its selection (https://github.com/PolymerElements/iron-selector/blob/master/iron-selectable.html#L330). You should listen to the paper-radio-group-changed
if you want to catch the selection change.