-
Notifications
You must be signed in to change notification settings - Fork 55
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
Multi input does not seem to update host property #103
Comments
I am seeing something similar when using the iron-multi-selectable.html behavior. From what I could track down, changes ( |
If I understand your problem correctly, I think your problem is, that the property selectedValues is an Array and therefore you should access its content by a dom-repeat template
And so there is not a problem |
fooloomanzii, thanks for the demo. However, I do not wish to use the output in a dom-repeat. I am using those values to filter other data, and so using selectedValues in a dom-repeat is not a solution for me. |
It might not be so well documented in the APIs, but you need to read how observation on Arrays work in Polymer for that. https://www.polymer-project.org/1.0/docs/devguide/data-binding.html
If you want to propagate received changes to the template, then it is simmular:
The part " .* " means, that you watch all subproperties. The observer-function gets an argument, what descibes all mutation operations happened on the Array, but you also can just access the original Array. I would also look into the code of iron-selector, because you could also adopt some ideas to reduce the code for what you want, so that your code is more efficient.
so that changes can be notified allover the DOM. But they really don't seam to work for selectedValues, allthough the changes are notified within the element: |
Thank you for the detailed reply fooloomanzii, that's enough for a workaround. |
@fooloomanzii That solution works fine when you are in your own <template is="dom-bind">
<paper-menu attr-for-selected="label" multi selected-values="{{selections}}">
<paper-item label="1">Network 1</paper-item>
<paper-item label="2">Network 2</paper-item>
<paper-item label="3">Network 3</paper-item>
</paper-menu>
<h1>{{selections}}</h1>
<template is="dom-repeat" items="[[selections]]">
<span>[[item]]</span>
</template>
</template> The |
http://jsbin.com/yaquqovaca/4/edit?html,output
Expected behavior:
Clicking on gamma will update the text field to show alpha,beta,gamma
Clicking on beta will further update the text field to show alpha,gamma
Observed behavior:
Clicking on gamma properly selects gamma, but does not update text field.
Clicking on beta properly deselects beta, but does not update text field.
The text was updated successfully, but these errors were encountered: