Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

iron-selector doesn't select in nested templates #47

Closed
fooloomanzoo opened this issue Jul 17, 2015 · 7 comments
Closed

iron-selector doesn't select in nested templates #47

fooloomanzoo opened this issue Jul 17, 2015 · 7 comments

Comments

@fooloomanzoo
Copy link

as an example:

image

but it doesn't select and I can't figure out why

Code: http://jsbin.com/zuqato/edit?html,console,output

@fooloomanzoo
Copy link
Author

it would look like this
image
and nothing happens

if i select in the upper template like
image

it works:
image

@Trakkasure
Copy link

In iron-selectable the get items() function queries only the distributed nodes. This would normally take care of it. However, templates embedded within another templates hide it's distributed nodes within the surrounding template. I understand using getDistributedNodes when no selectable attribute is specified. But why not just use querySelectorAll when a selectable attribute is specified?

Trakkasure pushed a commit to Trakkasure/iron-selector that referenced this issue Jul 25, 2015
… querySelectorAll to find selectable nodes.
@Trakkasure
Copy link

@fooloomanzii Updated with my fix here: http://jsbin.com/pimazupare/edit?html,console,output

@fooloomanzoo
Copy link
Author

Looks great! Thanks

@Trakkasure
Copy link

Firefox seems to have a problem with the solution on only one test. What is weird, is I can make the test succeed by setting the selected item in the test itself. (as long as the item is different than the default selected item) This test succeeds in Chrome. I cannot test Safari, the driver won't work.

bnavetta added a commit to bnavetta/skeleton-navigation-polymer that referenced this issue Aug 3, 2015
Trakkasure pushed a commit to Trakkasure/iron-selector that referenced this issue Aug 14, 2015
MrAntix added a commit to MrAntix/iron-selector that referenced this issue Sep 3, 2015
@notwaldorf
Copy link
Contributor

Closing as a duplicate of #42. Currently iron-selector only looks at immediate children.

@yglodt
Copy link

yglodt commented Mar 9, 2018

I have a somehow similar issue exposed with this code:

<iron-selector multi attr-for-selected="value" selected-values="{{selectedTimes}}">
	<template is="dom-repeat" items="[[days]]">
		<template is="dom-repeat" items="[[hours()]]" as="ind">
			<div value="[[itemval(item, ind)]]"></div>
		</template>
	</template>
</iron-selector>

Selection works well, the array selectedTimes is changing as expected.

But pre-setting selectedTimes does not mark any item as selected, strangely.

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

4 participants