Active
Project:
Views Infinite Scroll
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2017 at 09:14 UTC
Updated:
12 Jun 2026 at 09:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hog commentedComment #3
uzlov commentedlooks ok
need to test
Comment #5
hog commentedComment #6
sam152 commentedCan you point to some examples of this on the web that indicate this is the defacto expected behavior? I've never seen the behavior of scrolling to the new results in the wild.
Comment #8
t_stallmann commentedWe're running into what I think is a similar issue to this one, and adding a maybe simpler fix. I have a view with a "load more" button at the bottom; when a user clicks the pager to load more items, those items get inserted into the DOM above the pager node (which has focus), and so the view stays fixed at the bottom of the page. I think this is only an issue when you're using views infinite scroll without the autoscrolling behavior.
The desired behavior is that the user's view should stay centered on the last view item they were able to see, with new content below that they then scroll down to access. This patch does that by just storing the scroll state of the document before new nodes are added, and then restoring it afterwards.
Comment #10
hebl commentedFor anyone landing here trying to improve the accessibility of their infinite scroll, check out comment #4 on this issue page: https://www.drupal.org/project/views_infinite_scroll/issues/3173923
The patch forces keyboard focus onto the first item that is loaded.
Comment #13
t_stallmann commentedRerolled my patch to work with v2.0.x.
The patch @HEBL links to solves the accessibility issue, but it still leaves a weird UI experience where the page position jumps. I'm currently applying both patches, which seems to work well.
@Sam152 -- does my previous comment answer your request for more info? Just poking around and one example of a site "in the wild" which has the behavior I'd like to see is https://onemileatatime.com/.
Maybe there could be a setting to choose scroll behavior, with the current behavior as a default?
Comment #14
anybodyIs this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken.
2.0.x is the active development branch.
If nobody replies, we should assume this is fixed and close this issue outdated.
Thanks!
Comment #15
t_stallmann commentedComment #16
t_stallmann commentedStill active on 2.0.x and the patch still works.
Comment #17
anybodyThanks for the feedback! I don't think we should add this, as this simply scrolls to the top of the page, but if the view is already in a lower part of the page, it scrolls to an unexpected position.
To have something like this added, it needs to be configurable. So we should instead focus on the parent task: #3376481: [META] Add setting for scroll behavior (position, treshold, delay)
This one will not be merged as-is, as it doesn't fit well for all cases.
Comment #18
joachim commentedThis is surely a bug!
With JS disabled, the loading of more content is done with the 'Load more' button.
So:
1. I load the page
2. I scroll down, reading items
3. I reach the 'load more' button
4. I click it.
The expectation is that I see more content added where the button was, so I can continue reading smoothly.
Getting jumped back to the very top of the list is not good UX at all!