Handle noscript tags in head during ViewTransitions (#8091)
This commit is contained in:
parent
76a2ba270d
commit
56e7c5177b
2 changed files with 9 additions and 0 deletions
5
.changeset/shaggy-cameras-hide.md
Normal file
5
.changeset/shaggy-cameras-hide.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Handle `<noscript>` tags in `<head>` during ViewTransitions
|
|
@ -125,6 +125,10 @@ const { fallback = 'animate' } = Astro.props as Props;
|
|||
};
|
||||
|
||||
const swap = () => {
|
||||
// noscript tags inside head element are not honored on swap (#7969).
|
||||
// Remove them before swapping.
|
||||
doc.querySelectorAll('head noscript').forEach((el) => el.remove());
|
||||
|
||||
// Swap head
|
||||
for (const el of Array.from(document.head.children)) {
|
||||
const newEl = persistedHeadElement(el);
|
||||
|
|
Loading…
Reference in a new issue