Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

for #10634 Element duplication when copying root node #10653

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xyin96
Copy link

@xyin96 xyin96 commented Feb 25, 2015

for #10634
fixed element duplication when copy/pasting html tag.

The issue was sending a null as the oldElement in generateChildEdits, which implies an insertion edit.
The fix was to check if there was a root node in the oldNodeMap, and passing that node as the oldElement so that generateChildEdits had a node to compare to.

@xyin96 xyin96 changed the title for #10634 for #10634 Element duplication when copying root node Feb 25, 2015
@humphd
Copy link
Contributor

humphd commented Feb 25, 2015

Fantastic. Glad to see a patch for this so quickly. @xyin96++

@AJDBenner
Copy link

Just tested this code and I'm getting an error in the console: "data-brackets-id=1 not found".

@xyin96
Copy link
Author

xyin96 commented Feb 25, 2015

Yeah this patch generates that error. I don't know how to fix it, but from what I've noticed, the referenced id is the tagID of the old html tag, which I assume has been replaced and deleted when the user copies and pastes an html document into the editor.
However, this error should not stop the live preview from updating correctly.

@busykai
Copy link
Contributor

busykai commented Mar 3, 2015

@xyin96, @humphd let me think about this and experiment a little bit. it's quite possible that this case (entire DOM re-instrumentation) should be handled by different means, not by editing existing DOM on the remote.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants