I'm working on a small application with maquette js. This library uses a virtual DOM implementation. After some user event that triggers a change in the data store it causes a (partial) rerender including the creation of some new DOM nodes.
How can I make sure that one of the new nodes, which is a contenteditable div, gets the focus once it has been rerendered?
Similarly: how do I retain cursor position in a previously focused element?