-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: fix scrolling on iOS devices #5878
Conversation
@@ -1,5 +1,6 @@ | |||
/*--------------------- Layout and Typography ----------------------------*/ | |||
html { | |||
-webkit-overflow-scrolling: touch; |
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.
This enables momentum scrolling. The scrolling experience with it on is a lot better but its use is discouraged.
I've had no issues while testing but we can remove it if we think it will cause problems.
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'm not familar with the way IOS scrolls, but do I understand correctly that momentum scrolling is disabled by default on web pages and enabled in apps?
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.
Yes that's correct web pages, by default, don't have the same inertia apps have.
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.
Hmmm, I think this may have negative effects on macs? we should probably restrict it to some size? (wish there was a better way 😞 )
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.
Like what? I've tried it on my mac, and it doesn't seem to affect any of the browsers I've tested it on (Safari, Chrome, Firefox).
LGTM besides the momentum scrolling, which I have no opinion on. |
Probably dumb question - is there any way I could test this without pulling the branch and building the docs? The fix looks fine but I want to actually test it on my phone and that's problematic with the networking mechanics on this machine. |
@benjamingr You can connect your iOS device to a mac and use Safari dev tools from that mac, don't know if this helps. |
@@ -281,7 +282,8 @@ pre { | |||
vertical-align: top; | |||
background: #f2f2f2; | |||
margin: 1em; | |||
overflow-x: auto; |
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.
We are using white-space: pre-wrap;
now so this should be no longer required.
Still LGTM. Any more opinions regarding momentum scrolling? |
@silverwind I've found a new way to fix the issue. We can just reset the This also makes the scroll works like every other web page so we don't have to enable momentum scrolling. Question: isn't this stuff redundant? It's already included in the previous case. |
Yeah, definitely redundant. Maybe the Will check out your other changes soon. |
LGTM |
I've rebased against master and squashed commits into a single one. |
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Fixes: nodejs#5861 PR-URL: nodejs#5878
LGTM if @nodejs/documentation folks are happy. |
LGTM |
@lpinca something about this recent change makes text very tiny on Android Chrome, it looks like Chrome switches to non-mobile mode now. I'm thinking we should maybe specify <meta name="viewport" content="width=device-width, initial-scale=1"> and then remove the font-size rules in the media queries (the default 1.8em on |
@silverwind like this? |
Hmm doesn't work on the iPhone with the latest commit. |
Works for me on Android at least. Oh, and I noticed another minor issue with unbalanced margins on those @media only screen and (max-width: 1024px) { pre { margin-right: 0; } } |
We can't really use <meta name="viewport" content="width=device-width, initial-scale=1"> as it will reduce the screen size by half on retina displays.
+1 for the margin fix. |
I've removed the viewport meta tag and increased the font size in the media queries. It works fine on my iPhone. Waiting for feedbacks. |
Looking good on Android too. LGTM! |
Thanks! Landed in d2577de. |
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Also fixes a few minor styling issues that came up in the discussion. Fixes: #5861 PR-URL: #5878 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Also fixes a few minor styling issues that came up in the discussion. Fixes: #5861 PR-URL: #5878 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Also fixes a few minor styling issues that came up in the discussion. Fixes: #5861 PR-URL: #5878 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Also fixes a few minor styling issues that came up in the discussion. Fixes: #5861 PR-URL: #5878 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Also fixes a few minor styling issues that came up in the discussion. Fixes: #5861 PR-URL: #5878 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices. Also fixes a few minor styling issues that came up in the discussion. Fixes: #5861 PR-URL: #5878 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Pull Request check-list
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
Affected core subsystem(s)
doc
Description of change
Fixes an issue that prevented scrolling from going past large code blocks on iOS devices.
Fixes: #5861