Full page morph.
See original GitHub issueCurrently using jsdom for testing which could be part of the issue, but the following diff detaches the document element and fails.
morphdom(document.documentElement, `
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>content</body>
</html>
`);
Am I doing something wrong? Even tried removing the doctype.
Edit:
Also tried doing this directly in Chrome Version 51.0.2680.0 canary (64-bit)
and received the following error.
VM414:479 Uncaught DOMException: Failed to execute 'replaceChild' on 'Node': Nodes of type '#text' may not be inserted inside nodes of type '#document'
From: https://github.com/patrick-steele-idem/morphdom/blob/master/lib/index.js#L478
Edit2:
Looks like the issue stems from https://github.com/patrick-steele-idem/morphdom/blob/master/lib/index.js#L38 and https://github.com/patrick-steele-idem/morphdom/blob/master/lib/index.js#L41 in my case, but it looks like #toElement
just doesn’t support anything outside of body.
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Morphs - StimulusReflex
Page morphs are the default behavior of StimulusReflex and they are what will occur if you don't call morph in your Reflex. All...
Read more >Creating a full-page morph transition - GSAP - GreenSock
I am first interested in morph effects of page transitions . ... Create a morph SVG animation that covers the whole screen.
Read more >Simple Morphing Search - Codrops
The idea is to have a search input in the upper right corner of the page and once the input is clicked, the...
Read more >Morph transition: Tips and tricks - Microsoft Support
Learn how to use the Morph transition in PowerPoint to easily create animations and movements ... It shows a list of all the...
Read more >Using Morph to Highlight Parts of an Image in PowerPoint
Do you want to use a full screen image or even a large image on your PowerPoint slide and now you want to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please keep in mind that morphing HEAD tags client-side will probably not work for most use cases. For instance, og meta tags will not get morphed in time and Facebook will only see the sever-rendered ones.
Additionally, morphed script and link tags will likely become async and no longer block so you’d likely get flash of unstyled content or have scripts loading out of order.
@AutoSponge - That PR could be reverted. The issue was it appeared to be working but ended up actually just discarding the entire page in most cases. I just ended up rolling my own solution anyways.
Thanks both of you for getting back to me on this issue though.