I found a solution in a github issue here: 
https://github.com/Polymer/polymer/issues/4558

On Thursday, 20 April 2017 14:32:22 UTC+10, Matthew Palermo wrote:
>
> Hello Polymer Team!
>
> For the purpose of using <input> or any focusable component within the 
> <dom-repeat> component, is there a way to ensure a stable template instance 
> to array item mapping? I looked at the source code for the dom-repeat 
> components and it looks like this happens when array items are modified but 
> when a splice is applied to the array, a full re-render is performed. I 
> found that when I use splice to add or remove items to the array, the focus 
> does not behave as expected. The focus will act as if the template 
> instances are bound to the array indexes such that if the n'th element is 
> in focus and an array item with index <n is removed, the n'th element will 
> still be in focus. I would expect that the n'th element (along with the 
> focus) move to the n-1'th element.
>
> It seems that there is enough information passed into the change observer 
> for this to be possible (at least in the use case that I am considering). I 
> think I will be able to make a simple problem specific implementation 
> (without all the render debouncing, frame rate targeting, etc that 
> dom-repeat has). But I don't understand the dom-repeat code enough to be 
> able to properly redesign it. Perhaps someone could point me to the parts 
> of dom-repeat that would need to be modified and I could have a go.
>
> Regards,
> Matthew
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/0d776ecd-cc82-45a1-828f-58549d37aec4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to