google / incremental-dom

An in-place DOM diffing library
http://google.github.io/incremental-dom/
Apache License 2.0
3.54k stars 180 forks source link

Handle case where a node rendered during serverside rendering is focused #369

Closed iteriani closed 6 years ago

iteriani commented 6 years ago

User story:

Server-side render a template. Immediately focus on an element. Patch an element that had focus.

Right now a code path gets triggered where an element gets an undefined key. The patch then goes in with a defined key and deletes the element. This code defers the serverside rendered state until a proper key can be attached.

sparhami commented 6 years ago

Thanks for bringing this up. I wanted to solve this a bit differently, so I created #370 which solves for this case.