I define a node view, it return one input box. I insert it into an empty document, and type something in the input. Then, I type something before the input, the input’s content will be cleared. I think the reason is because of the typing, Prose delete the input node, and then insert a new one. so my question is how to restore the old input’s content to the new input.
You could have the node view register an
input event handler on the field, and update the parent document (where you might store the content in an attribute).
Could you give me a simple example? Because I don’t know what you mean by parent document. Does it mean DOM.Node or Prose.Node or something else? thanks a lot.
Not really, because I don’t really know what you are doing. The idea I was alluding to is to create a transaction on the editor document, so that the node that the view applies to is updated in a way that stores the current field content, so that even when it is redrawn, it’ll have that content.