-
Notifications
You must be signed in to change notification settings - Fork 198
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
iPhone scrolling is painful #595
Comments
Hmm, maybe we should have gone with #510 after all ... cc @GuillaumeGomez @Koxiaet |
FWIW the standard practice for the link-offset-with-fixed-header issue in that thread is to have an explicit, invisible, empty anchor tag with a name (maybe an id attribute instead, I’d have to check), absolutely positioned, relative to the original heading, with |
For an example, open the devtools on this header: https://aglc4.cormacrelf.net/csl#3.1-Generally |
@cormacrelf would you be willing to make a PR implementing those CSS changes? It sounds like you know what you're talking about 😆 |
@jyn514 It would also dig into generating the HTML — it might be a bit tricky if you’re just slapping rustdoc output in a template. would appreciate a few pointers on how you’d like links to be transformed, if there’s another option than adding it to rustdoc itself or reparsing the whole thing. The CSS is pretty easy after that. |
(And if that turns out to be a significant blocker, I would request reverting the top bar change that introduced this issue as an interim measure, as usability has been impacted so much.) |
That's unfortunate, we are indeed just slapping rustdoc output into a template. Maybe you could coordinate with @GuillaumeGomez to change how rustdoc outputs HTML? |
Hmm but that doesn't fix old docs. This is definitely a hard problem, I can make a PR reverting the other changes in the meantime. |
Reverting the changes would bring back the anchor issue. :-/ |
I think they mean reverting all they way back to before the top bar was fixed (position: fixed, that is). |
Oh. That'd fix all issues then. :) |
Sometimes a bit of vanilla JS on document load to insert anchors is just the right kind of solution. I’ll have a look at doing it that way, without changing rustdoc / having to queue a rebuild of every crate. |
Scrolling is working on my phone (iPhone 8+) I did notice that sometimes, it would pause for a second like it was loading, before scrolling started working. Is it every iPhone, or just some iPhones? |
I ran it locally and div.container-rustdoc {
text-align: left;
+ -webkit-overflow-scrolling: touch;
} You'd still lose out on being able to go back up quickly by tapping the top bar, but I think it alleviates a lot without having to rewrite a large part of the layout right now. I could submit a pull request for that if that would suffice, but perhaps I'm missing something @cormacrelf? |
This also appears to make scrolling very laggy in macOS Safari (Version 13.0.5 (14608.5.12)) and Safari Technology Preview (Release 100 (Safari 13.2, WebKit 14610.1.2.1) and whenever switching back to the tab there's a flash of a blue border around the I tested removing both |
@cormacrelf we reverted the change that happened around the time you opened the issue. Can you confirm whether the problem is fixed? |
@cormacrelf @Nemo157 @imjasonmiller Could one of you please confirm whether #610 helped with this issue? |
Sorry @jyn514, I didn't see your first reply! It doesn't seem to have helped me with this issue, but perhaps I'm doing something wrong? After visiting the documentation for
|
Ok, this bug must have existed for a while then since the CSS isn't updated all that often. I guess that means we can merge #611 (with apologies to @Zexbe for reverting their change). If anyone wants to work on fixing this I'm happy to mentor but without an iPhone or Safari I can't really test any changes. |
I'm on the linked page with a friend's iPhone and I can't replicate any of the mentioned issues. This is an iPhone 8 with iOS 13. Can you post your version of iOS? |
@jyn514 it's an older iPhone 5S, so that's iOS 12 still. |
Having this issue on an iPhone 6 also, so iOS 12. |
Should be fixed in #873. |
Recently, docs.rs gained a fixed header bar. To accommodate this, all other content on the page was moved into an
overflow: auto
div of some kind. This is a problem. For context, there are two kinds of scrolling used on websites in Safari on an iPhone:Type 1 is used for entire pages where the document is larger than the viewport. Type 2 is used for overflowing content, e.g. wide code blocks clipped to viewport width, scrolling horizontally.
It used to be that docs.rs pages were bigger than the viewport, and scrolled with type 1. Now that the entire page is in an
overflow: auto
div, Type 2 is used on everything. This means:Together, this is very painful UI. I use docs.rs from my phone every day. Please use
position: fixed
for fixed position navigation bars, or don’t do them at all.The text was updated successfully, but these errors were encountered: