-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Docs: Fix Safari scrolling to anchors in iframes. #32312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mrdoob
wants to merge
2
commits into
dev
Choose a base branch
from
docs-safari
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested a bit more and it seems increasing the timeout from
100to200solves the issue on my macMini.Given that
TSL.htmlis by far the largest document, the Safari probably needs more time to make the page ready.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we find no other solution, I would like to file a bug at the WebKit bug reporter. I've already searched but found no open bug about
scrollIntoView()issues in context of iFrames.https://bugs.webkit.org/buglist.cgi?bug_status=__open__&content=scrollIntoView&no_redirect=1&order=Importance&product=WebKit&query_format=specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrdoob I've increased the timeout from 100ms to 250 ms which worked on my macMini and an iPad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increasing the time out does not work for me. I tried searching for "translate".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With what devices have you tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M1 iMac MacOS Tahoe 26.1 Safari 26.1.
To be clear, when searching for "translate", sometimes it works, and in other cases the iframe is blank, and scrolling is necessary to locate the proper position in the file.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for me on all my devices. But it starts failing if I decrease the timeout value.
Just for fun I have removed the
element.scrollIntoView()call. In Chrome and Firefox, the navigation is still correct but Safari fails. The page in the iFrame is blank and the content only appears if I scroll up. Trying to select text also works.So it seems the issue is not related to
scrollIntoView(). The iFrame page isn't correctly loaded in the first place and that's maybe whyscrollIntoView()fails as well.