diff options
-rw-r--r-- | .changeset/shaggy-cameras-hide.md | 5 | ||||
-rw-r--r-- | packages/astro/components/ViewTransitions.astro | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/.changeset/shaggy-cameras-hide.md b/.changeset/shaggy-cameras-hide.md new file mode 100644 index 000000000..7ae940935 --- /dev/null +++ b/.changeset/shaggy-cameras-hide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Handle `<noscript>` tags in `<head>` during ViewTransitions diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro index 05fc57aa6..28a17a09d 100644 --- a/packages/astro/components/ViewTransitions.astro +++ b/packages/astro/components/ViewTransitions.astro @@ -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); |