News for hackers. Stuff that matters.

Ask HN: Can any browsers scroll a page of text properly using the spacebar?

Many websites now have a fixed div at the top or bottom of the page. The "spacebar to scroll a page" feature of most browsers is broken on these pages. It uses a naive method of scrolling the window height, when it should be scrolling the height of the frame which is scrollable.

Do any browsers do this properly, or are they all broken?

Example website with fixed divs that scrolls too far using spacebar:

https://www.theatlantic.com/magazine/archive/2022/05/social-media-democracy-trust-babel/629369/

( 3 comments | 2 points | on HN )
Re:Ask HN: Can any browsers scroll a page of text properly u... by porbelm on Tuesday April 12, 2022 @05:17AM (#31000319)
Firefox 99 on macOS 12.3.1 scrolls /almost/ a page per spacebar keeping the last two or so lines visible at the top after scroll, so...

perfect, in my book.

Re:Ask HN: Can any browsers scroll a page of text properly u... by bryanrasmussen on Tuesday April 12, 2022 @03:58AM (#30999826)
I don't really understand I guess, I loaded the page, clicked away the modal and then pressed the spacebar, scrolled all the way to the bottom of the page.

Is that not what is supposed to happen?

Browser - FF developer.

Re:Ask HN: Can any browsers scroll a page of text properly u... by HigherPlain on Tuesday April 12, 2022 @04:26AM (#30999990)
To clarify, if there is a fixed div at top or bottom of page, then pressing space scrolls too far, missing a paragraph of text.