You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all I want to thank you for your efforts maintaining this library, it's been integral for detecting changes and maintaining undo history for an inline editor I've been working on.
Recently I ran into a problem where characterDataChanged was empty for a summary in which a text node is first emptied (node.data = "") and then removed from the dom. The resulting summary lists the removal of the node but not the changed characterData ( open console on http://jsfiddle.net/f153aczu/2/ )
This is causing problems with performing undo/redo as the node can be restored, but the text content of the Node is lost. That's why I suggest the following change (aartrost/mutation-summary@7936be7):
if (2 /* STAYED_IN */ !== this.treeChanges.reachabilityChange(target))
Hi Rafael,
First of all I want to thank you for your efforts maintaining this library, it's been integral for detecting changes and maintaining undo history for an inline editor I've been working on.
Recently I ran into a problem where characterDataChanged was empty for a summary in which a text node is first emptied (node.data = "") and then removed from the dom. The resulting summary lists the removal of the node but not the changed characterData ( open console on http://jsfiddle.net/f153aczu/2/ )
This is causing problems with performing undo/redo as the node can be restored, but the text content of the Node is lost. That's why I suggest the following change (aartrost/mutation-summary@7936be7):
if (2 /* STAYED_IN */ !== this.treeChanges.reachabilityChange(target))
->
if ([2 /* STAYED_IN */, 5 /* EXITED */].indexOf(this.treeChanges.reachabilityChange(target)) === -1)
This change will enable the reporting of characterDataChanged for removed nodes, enabling users to properly restore said nodes.
PS: If you're interested I can propose an example based on my custom undo/redo build on top on mutation-summary.
The text was updated successfully, but these errors were encountered: