mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
Fix DEV mode on Safari when view transitioning to client:only components (#9000)
* Fix DEV mode on Safari when view transitioning to client:only components * Update .changeset/eighty-ladybugs-shake.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
This commit is contained in:
parent
4983acea8c
commit
35739d01e9
2 changed files with 7 additions and 3 deletions
5
.changeset/eighty-ladybugs-shake.md
Normal file
5
.changeset/eighty-ladybugs-shake.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes an error in dev mode on Safari where view transitions prevented navigating to pages with `client:only` components
|
|
@ -529,9 +529,8 @@ async function prepareForClientOnlyComponents(newDocument: Document, toLocation:
|
|||
if (newDocument.body.querySelector(`astro-island[client='only']`)) {
|
||||
// Load the next page with an empty module loader cache
|
||||
const nextPage = document.createElement('iframe');
|
||||
// do not fetch the file from the server, but use the current newDocument
|
||||
nextPage.srcdoc =
|
||||
(newDocument.doctype ? '<!DOCTYPE html>' : '') + newDocument.documentElement.outerHTML;
|
||||
// with srcdoc resolving imports does not work on webkit browsers
|
||||
nextPage.src = toLocation.href;
|
||||
nextPage.style.display = 'none';
|
||||
document.body.append(nextPage);
|
||||
// silence the iframe's console
|
||||
|
|
Loading…
Add table
Reference in a new issue