-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with polymer 1.0 paper-radio-group dom-repeat templates and the selected property #8
Comments
+1 regarding the usage of |
I've noticed similar problems when using a |
The workaround proposed by @jongeho1 did the trick for us: Have the application wait until the browser event loop returns before setting the 'selected' property. |
I identified another issue with
|
@ghawkins-pulsemining I think the original issue is fixed in the latest release ( |
@ghawkins-pulsemining For displaying buttons veritcally, all you need is to set
|
confirmed this fixed on FF and Chrome, nice job. I can't seem to initially select the first element (I can initially select the 2nd, 3rd, etc.), but quickly testing, so could be something else. |
Yay! I had this, which selects the first item on all the things, so maybe your example is grumpy:
|
<dom-module id="radio-group">
<style>
</style>
<template>
<paper-radio-group selected="0">
<template is="dom-repeat" items="[[data]]">
<paper-radio-button name="[[index]]">[[item.title]]</paper-radio-button>
</template>
</paper-radio-group>
<iron-ajax auto url="http://jsonplaceholder.typicode.com/posts" handle-as="json" last-response="{{data}}">
</iron-ajax>
</template>
<script>
Polymer({
is: 'radio-group',
properties: {
data: {
type: Array,
notify: true,
observer: 'dataChanged'
}
},
dataChanged: function(data) {
console.log(data);
}
});
</script>
</dom-module> |
Awesome! Closing this! 💃 🎉 |
Hi,
I am having issues in polymer 1.0 with the paper radio group, specifically when using the selected attribute, but only when the paper-radio-buttons contained within are in a dom-repeat template.
Also note that If any dom-repeat template breaks, all break paper-radio-group dom-repeat templates break.
i.e if second group below is commented out, the first one works, if it is included, both the first and second templated groups break. Selected attribute always works on non-templated radio buttons in the group.
and defining the equivalent sizes array in ready:
On a side note also, i am trying to set vertical layout to the buttons (), which i can do using the @apply(--layout-vertical); style, however alignment is forced in flex-direction: column. Only way i can get it to align correctly with the radio buttons with their labels is to force flex-direction: row using !important. Is there a good way of toggling vertical alignment?
paper-radio-button[vertical="true"] { @apply(--layout-vertical); flex-direction: row !important; }
Many thanks,
Grant.
The text was updated successfully, but these errors were encountered: