Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Preview : Duplicates elements on copy/paste of entire document #13069

Open
core-ai-bot opened this issue Aug 31, 2021 · 3 comments
Open

Comments

@core-ai-bot
Copy link
Member

Issue by gideonthomas
Thursday Feb 19, 2015 at 17:38 GMT
Originally opened as adobe/brackets#10634


Hi,

It seems like when you copy and paste an entire html document into the editor (that already has content), DOM elements in the body are duplicated in the Live Preview. This happens regardless of whether the new body content you paste in is the same or different.

I am running the latest version of Brackets on Mac OS X Mavericks.

Here's a screencap of it:
livepreviewfail

Thanks :)

@core-ai-bot
Copy link
Member Author

Comment by gideonthomas
Thursday Feb 19, 2015 at 17:52 GMT


I dug into the code a bit and I think I tracked it down to this function

This statement results in null because the new <html> tag gets a new tagID which cannot be mapped to a corresponding <html> tag in the old DOM structure.

So, it fails the if(oldElement) check and executes this. In the function generateChildEdits, it fails this condition, not entering the loop where the delete/insert operation (delete the old html tag with the old tagID and insert the new one) happens. It instead only does the insert operation.

Seems like the problem comes from passing in null as the first parameter into generateChildEdits. But not sure how to fix it though.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Feb 19, 2015 at 21:22 GMT


Possibly related to #5336

@core-ai-bot
Copy link
Member Author

Comment by MohabAli
Tuesday Oct 31, 2017 at 12:57 GMT


solved ... just disable (StaticServer)
go to ... Extension manager >> Default >> disable (StaticServer)
and use an alternative (Autosave) extension then enable (auto save (400 ms))
it will be in (File) after installation
https://github.com/nmaxcom/brackets-autosaver
run (live preview) enjoy

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

No branches or pull requests

1 participant