Skip to content

Commit 3fa40fe

Browse files
Docs: Fix white flash on iframe load for Safari (#29419)
* Docs: Fix white flash on iframe load for Safari * Fix white page for root level /docs page (when no page is selected) * Update index.html Fix code style. * Remove unnecessary error event listener --------- Co-authored-by: Michael Herzog <[email protected]>
1 parent 09f1c61 commit 3fa40fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,23 @@ <h1><a href="https://threejs.org">three.js</a></h1>
529529
const oldIframe = iframe;
530530
iframe = oldIframe.cloneNode();
531531

532+
iframe.style.display = 'none';
533+
532534
if ( hash && titles[ splitHash[ 0 ] ] ) {
533535

536+
iframe.onload = function () {
537+
538+
iframe.style.display = 'unset';
539+
540+
};
541+
534542
iframe.src = splitHash[ 0 ] + '.html' + splitHash[ 1 ];
535543
subtitle = titles[ splitHash[ 0 ] ] + splitHash[ 1 ] + ' – ';
536-
iframe.style.display = 'unset';
537544

538545
} else {
539546

540547
iframe.src = '';
541548
subtitle = '';
542-
iframe.style.display = 'none';
543549

544550
}
545551

0 commit comments

Comments
 (0)