by Dalewyn · 4y ago · 0 comments
One of the purposes of a scroll bar is to indicate how long (and/or wide) some piece of content is relative to your window. Another purpose is to indicate your current X/Y position within some piece of content.
Both of those purposes are completely broken with the use of infinite scrolling, because the length (and/or width) of the content keeps changing (increasing) and thus your position in that content also keeps changing.
I shouldn't have to explain how terrible this is from both accessibility and simple practicality standpoints.
The item you wanted to search might get unloaded, or not loaded yet, in some bizarre attempt at optimization when the javascript library resposible is an order of magnitude larger than the actual content anyway.
My phone has gigabytes of memory. If you want to present five hundred items in a web shop, just list them and do not bother with any type of pagination, invisible or otherwise.
If you click on an item after significant scrolling, view the item, then click back, where are you? almost never where you were. Usually just at the top of the list.
The scroll bar and find function can be mitigated, but not as elegantly.
The real problem is that, when you load a page in the middle, it’s easy to scroll down, but scrolling UP is glitchy. That one can’t be fixed. https://meta.discourse.org/t/scroll-jank-when-scrolling-up/1...
I don’t think there is an easy answer here. All options have some trade offs.
I always thought the infinite scroll pattern was designed for analytics purposes. So that you can track user engagement. Not because technology constraints necessitated it or that it was a good user experience.
I love infinite scrolling for random content. There is no “position” so to speak. And there is no concept of “find” since you don’t know what you’re looking for. “Back” continues to work as long as your browser cached the previous page state.
Sometimes you really do want to simulate an infinite list of 4,000,000 entries!
An example: https://wikiscroll.blankenship.io
On the other hand, it seems to me that this is partly the fault of the scrollbar as an idea. How do you show the current position in a document for which, for one reason or another, you cannot instantly compute the visible height? I still remember an Android PDF viewer which would run through every page of a 2000-page document to get the page dimensions before displaying anything. (From what I can see, modern viewers display the first page instantly by accepting being caught in their lie when a PDF has pages of wildly varying size.) Even a gigabyte of Unicode plain text with no line breaks in a proportional font is a serious problem. I don’t think we can special-case network streaming here (although it’s not unimportant either).
The relative position inside an infinite stream is always 0, and the height of the scrollbar handle (showing relative size of the viewport relative to the entire document) is also 0.
As the size of a finite-sized document grows, these problems also show.
Problems are: you can't click on the handle since its size is close to 0; you can't click above the the handle to do effectively go one page up, since the handle is at position 0 (or close to it).
Scrollbars are pretty useless for large documents, even more so for infinite streams.
"How do you show the current position in a document for which, for one reason or another, you cannot instantly compute the visible height? "
Actually, that sounds like an idea, make the height of the page roughly the real height of the total pages. It can still load content on scroll, but being able to leap ahead a few pages sounds great. Now if we can just get it to remember our position when we hit back, and not just return us to the beginning of the adventure, then infinite scroll would be tolerable.Perhaps by not "instantly" displaying the document- that is, displaying it before you are able to display its scrollbar.
[1] https://matterandinteractions.org/
[2] https://www.macmillanlearning.com/college/ca/product/Life-Th...
Maybe the metaphor of the scrollbar is just a bad one?
I feel that this is akin to that. I strongly believe both perspectives are valid for often overlapping contexts.
Pagination doesn't work either, because data can shift and you get repeated elements (if the page size is less than the remaining data when moving back to the start) or else truncated pages, or you start on page 10 and move backwards to page -3 before reaching the start. If you jump to a particular element, it requires you to know the absolute offset of all data to calculate page numbers correctly, which when jumping and filtering a large table might be a significant performance cost. Plus it breaks up content - if you're looking at chat history for example, often related messages are broken up into several smaller messages. Having one message on page 10 and the remainder on page 11 would be a terrible experience.
Don't blame this on designers, infinite scroll has been around (apparently?) almost 20 years now. Browsers still don't have an accessible solution despite the ubiquity of this pattern today - browser devs are to blame.
Heck—maybe it’s not even browsers, but websites. I’m pretty sure a website could change the URL as you scroll, so if the page is reloaded (or bookmarked, etc) you’re brought back to where you left off. I usually dislike it when websites mess with URLs, but this seems like an excellent use case!
The web was designed from the ground up to display documents, so we would have to resort to URL hacks.
HTML can stick around indefinitely for legacy websites and truly static pages, but browsers should introduce a new standard DOCTYPE optimized for what we actually want the web to do.
There’s nothing magical about this that a “real app framework” gives you.
Which is all fun and games until the “page” is actually a mutable and constantly changing list. With a mutable list there is no concept of “where you left off”.
Reddit used to struggle with this back in the day. The way they did pagination was to say "show the next page after id postId=xyz123". Since the algorithm kept re-sorting the posts on the front page, the content moved around quite a lot and you'd see the same things re-appearing on page after page, and sometimes post xyz123 was deleted and then everything broke.
It also breaks the back button, in all implementations I have seen so far.
I dunno. Shit ain’t easy once you think about it for a while.
If all you have is a static unchanging set of items… might as well just use old school pagination! At least in my opinion. It’s when the list of items is constantly changing that things get interesting.
Scroll position as measured by a scroll bar doesn’t make sense for an infinite (or indefinite) document. That doesn’t make an infinite document bad.
Seems fine to me? New content is appended, so the length and your position changes. Scroll bar reflects what’s going on. What’s the problem?
An accurate and consistent scroll bar is a valuable navigation tool, please don't break it.
Opening modals changes the scrollbar length. Opening accordions do too. The scrollbar doesn't "break" when content is added to a page, it just adjusts accordingly. It seems like this is all good, expected behavior; not an a11y concern.
It's not perfect but I don't really care to improve it and no one has had any complaints.
Check it out here: https://sayartii.com/search
N.b. it's incredibly slow, because it has to load every batch above the scroll position first. Try going to the bottom of the page and seeing how long it takes for results to render.
I also think the scroll bar is an entirely desktop tool, and as infinite scrolling most benefits mobile, this is a moot point. Nobody on mobile uses the scroll bar.
Personally, as a middle-click-and-hold'er, I do not use the scroll bar. I just went through my pages and frankly I'm surprised how the bar looks. I honestly never look at it or use it.
As this article demonstrates the scrolling on mobile as well, I have to point out that your complaints are sadly more of edge cases w.r.t. to the products we're making for the general public.
If you know how many items there are and all the items have the same height, then you can simply set the height of your container for the scrollbar to be accurate.
Furthermore you can listen to the scroll event and load the correct items if the user uses the scrollbar to jump to a particular spot.
So I think the bigger problem is a) people being lazy and not implementing this properly b) using this pattern where the preconditions don’t hold.
"Infinite" scroll isn't breaking anything, the content all broke scrolling inherently.
For example with two sites you now have two URLs and need to figure out which experience a browser should actually see. If I’m on a desktop and somebody sends me a mobile link, which page should I see?
And how would you do that when there is infinite scroll?