GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: Fix documentation and browser back button issue by pittyplatsch · Pull Request #5716 · nodejs/node

Conversation

@pittyplatsch

@pittyplatsch pittyplatsch commented Mar 15, 2016

Copy link
Copy Markdown

I couldn't find any other issue or discussion thread but I'm new to Node and therefore spending a lot of time with the docs. It's quite annoying that the browser back button is not working when one has jumped to an anchor within a page and then wanting to go back to the index with the browser back functionality. Removing the suggested line fixes the issue. I don't really know what it's good for, so if anyone could tell me and propose a different fix I'd be happy too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pittyplatsch
docs: Fix documentation and browser back button issue
bda584d
@evanlucas

evanlucas commented Mar 15, 2016

Copy link
Copy Markdown
Contributor

Thanks for the contribution! This actually breaks scrolling completely for me in Chrome on OS X, so I think we will have to find a different solution.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex added the doc Issues and PRs related to Node.js documentation. label Mar 15, 2016
@pittyplatsch

pittyplatsch commented Mar 15, 2016

Copy link
Copy Markdown
Author

@evanlucas Indeed, for me (FF on Ubuntu) too. Didn't even notice that, was just happy that the browser behaviour was as expected.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pittyplatsch
docs: Fix documentation and browser back button issue
6d0f4f8
@pittyplatsch

pittyplatsch commented Mar 15, 2016

Copy link
Copy Markdown
Author

Some more changes. Scrolling now functional again, sorry for my earlier ignorance.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented Mar 15, 2016

Copy link
Copy Markdown
Contributor

cc @nodejs/documentation

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Mar 15, 2016

Copy link
Copy Markdown
Contributor

Looks to be working in Firefox, Chrome and Safari on OS X. Will test on Windows later.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Mar 16, 2016

Copy link
Copy Markdown
Member

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the lts-watch-v4.x label Mar 16, 2016
@silverwind

silverwind commented Mar 16, 2016

Copy link
Copy Markdown
Contributor

@pittyplatsch tested in IE10, Chrome, Firefox on Windows and noticed one regression: scrolling the sidebar all the way to the bottom in Chrome (all platforms) and IE "bubbles" the scroll to the main section.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pittyplatsch

pittyplatsch commented Mar 17, 2016

Copy link
Copy Markdown
Author

@silverwind I see what you mean but don't think it's unnatural or unexpected behaviour that the scrolling continues in the main div of the page if an end is reached in the navigation div. Having the back button not working however is unexpected.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Mar 17, 2016

Copy link
Copy Markdown
Contributor

@pittyplatsch FWIW, the scrolling issue was reported as a bug here, I don't really want to introduce it again. Is it not possible to fix both issues?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Mar 18, 2016

Copy link
Copy Markdown
Contributor

Maybe something like this is in order to prevent the scroll "bubbling". The DOMMouseScroll isn't strictly necessary as only Firefox uses that event and it isn't affected right now, but I guess it won't hurt.

function scroll(e) {
  var delta = (e.type === 'mousewheel') ? e.wheelDelta : e.detail * -40;
  if (delta < 0 && (this.scrollHeight - this.offsetHeight - this.scrollTop) <= 0) {
    this.scrollTop = this.scrollHeight;
    e.preventDefault();
  } else if (delta > 0 && delta > this.scrollTop) {
    this.scrollTop = 0;
    e.preventDefault();
  }
}
document.getElementById('column2').addEventListener('mousewheel', scroll);
document.getElementById('column2').addEventListener('DOMMouseScroll', scroll);
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stevemao

stevemao commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

cc @nodejs/website

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stevemao

stevemao commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

@pittyplatsch interesting. I didn't know css position would break history buttons with anchor links. Any references on this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pittyplatsch

pittyplatsch commented Mar 23, 2016

Copy link
Copy Markdown
Author

@silverwind Thanks for linking nodejs/nodejs.org#513 – interesting insights. I personally have no problem with the bubbling, on FF there's a delay which seems like a nice compromise. I too found people discussing using JS to influence the browsers default behaviour (http://stackoverflow.com/questions/5802467/prevent-scrolling-of-parent-element) and also browser developers are discussing it: https://bugs.chromium.org/p/chromium/issues/detail?id=162179. Personally I don't think it's necessary.

@stevemao Only came across it in this particular case. It drives me crazy and I was surprised it hasn't been mentioned before by someone else.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Apr 21, 2016

Copy link
Copy Markdown
Member

What's the status on this one?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Apr 21, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I'd sign it off if a solution to the scroll bubble issue is provided, be it #5716 (comment) or (preferably) a CSS only solution.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pittyplatsch

pittyplatsch commented Apr 22, 2016

Copy link
Copy Markdown
Author

Sorry, I won't fix the bubbling. Take it as it is or feel free to close it...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Apr 22, 2016

Copy link
Copy Markdown
Contributor

In that case, I'll have to close it as it fixes one issue, but regresses another. The issue is not forgotten, thought. I have a few minor tweaks to docs CSS in mind, and I'll try to work out something regarding this problem.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind silverwind closed this Apr 22, 2016
@MylesBorins MylesBorins removed the lts-watch-v4.x label May 3, 2016
@silverwind silverwind mentioned this pull request May 8, 2016
doc: search indicators missing #6637
Closed
@silverwind silverwind mentioned this pull request May 8, 2016
doc: fix issues related to page scrolling #6641
Closed
2 tasks done
silverwind added a commit to silverwind/node that referenced this pull request May 11, 2016
@silverwind
doc: fix issues related to page scrolling
15df52a
Moved the sidebar to a fixed position and moved the positioning of the
main content to the page's body, which results in back/forward
navigation through hash links and search highlight working again.

Fixes: nodejs#6637
Based on: nodejs#5716
silverwind added a commit that referenced this pull request May 15, 2016
@silverwind
doc: fix issues related to page scrolling
bef1ec0
Moved the sidebar to a fixed position and moved the main column to the
page's body, which results in back/forward navigation through hash
links and search highlight working again.

Fixes: #6637
Fixes: #6751
Based on: #5716
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Robert Lindstaedt <[email protected]>
silverwind added a commit to silverwind/node that referenced this pull request May 15, 2016
@silverwind
doc: fix issues related to page scrolling
f2630d2
Moved the sidebar to a fixed position and moved the main column to the
page's body, which results in back/forward navigation through hash
links and search highlight working again.

Fixes: nodejs#6637
Fixes: nodejs#6751
Based on: nodejs#5716
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Robert Lindstaedt <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 16, 2016
@silverwind Myles Borins
doc: fix issues related to page scrolling
06854f1
Moved the sidebar to a fixed position and moved the main column to the
page's body, which results in back/forward navigation through hash
links and search highlight working again.

Fixes: #6637
Fixes: #6751
Based on: #5716
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Robert Lindstaedt <[email protected]>
evanlucas pushed a commit that referenced this pull request May 17, 2016
@silverwind @evanlucas
doc: fix issues related to page scrolling
4f2a55f
Moved the sidebar to a fixed position and moved the main column to the
page's body, which results in back/forward navigation through hash
links and search highlight working again.

Fixes: #6637
Fixes: #6751
Based on: #5716
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Robert Lindstaedt <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 18, 2016
@silverwind Myles Borins
doc: fix issues related to page scrolling
126fdc3
Moved the sidebar to a fixed position and moved the main column to the
page's body, which results in back/forward navigation through hash
links and search highlight working again.

Fixes: #6637
Fixes: #6751
Based on: #5716
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Robert Lindstaedt <[email protected]>
@karencapiiro karencapiiro mentioned this pull request Nov 30, 2023
[Snyk] Fix for 1 vulnerabilities karencapiiro/node#30
Open
@AshdonG AshdonG mentioned this pull request Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities AshdonG/node#46
Open
@BryanLaura BryanLaura mentioned this pull request Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities BryanLaura/node#66
Open
@Supermajestcd Supermajestcd mentioned this pull request Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities Supermajestcd/node#18
Open
This was referenced Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities MaxMood96/node#39
Open
[Snyk] Fix for 1 vulnerabilities Mement-Mori/node#34
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

doc Issues and PRs related to Node.js documentation.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@pittyplatsch @evanlucas @Fishrock123 @silverwind @jasnell @stevemao @mscdex @MylesBorins
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.