Docs: Fix white flash on iframe load for Safari #29419
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Navigating the documentation while using Safari the iframe responsible for loading page content flashes white as it's loading (see attached screen recoding).
Screen.Recording.2024-09-16.at.12.42.13.PM.mov
Safari Version 17.6 (19618.3.11.11.5)
Solution
Move the iframe "display none" out of the if condition so it's hidden before the src is set and "display unset" on iframe load/error regardless of the if condition. Not sure if the error listener is really needed but kept it there to be safe.
Edit (6834f41):
Moved the load/error event listeners to inside the if condition, which keeps the iframe hidden when there's no page selected.
Screen.Recording.2024-09-16.at.12.52.46.PM.mov
I'm new to contributing, let me know if there's anything else to do!