Whenever each new page is loaded, the View should scroll to the top of the new list.

CommentFileSizeAuthor
#7 284413.patch873 bytesGurpartap Singh

Comments

merlinofchaos’s picture

I'm sorry, I don't understand what you mean. You've woefully neglected to provide any kind of context.

sami_k’s picture

Sorry about that Earl. I mean when you have a view with a pager that loads the next page using ajax. When you click the pager and load the next page, say page 2, it does not scroll to the top of the page and instead stays exactly in scroll position that it was in on the last page, which means the bottom of the page. The user then has to scroll to the top themselves in order to view Page 2. It should scroll to the top of the page every time a new page loads via ajax or ideally the first item in the view. Does that make enough sense, I can provide screen shots if you're still not clear on what I mean.

merlinofchaos’s picture

Category: bug » feature

Hmm. I see. I'll give that some thought.

Since that behavior was never intended I"m classifying this as a feature request.

dropchew’s picture

Its good to have this feature, users will expect the page to go to the top. subscribing and thanks

matt_paz’s picture

Also subscribing ... wish there was a better way to do that ... sorry about the noise. +1 on this feature request from me.

Gurpartap Singh’s picture

Title: Ajax pager needs to go to top at new page load » Smooth scroll to top of page in AJAXed pager

It's there in views now.

May I ask if a patch for smooth scrolling to the top will be entertained? Some users might get surprised by a sudden scroll, whereas with a smoother animation at least they'll know something's happening and it's taking them to top.

Gurpartap Singh’s picture

Title: Smooth scroll to top of page in AJAXed pager » Smooth scroll to top of page with AJAX page loading
StatusFileSize
new873 bytes

And without asking, here it goes(I'm using the same in paging dev):

matt_paz’s picture

Seems to work well.

merlinofchaos’s picture

Somehow I'd missed that scrollto actually going in; it must've been in one of Nedjo's patches and I didn't see it.

Gurpartap, do you know if it's possible to analyze where we're scrolling to and see if it's already visible? If it is, I would really like to NOT scroll and only do so if it's not visible. I've already found this kind of annoying once.

gunzip’s picture

I can see at least one case when scrolling is annoying:

if you have a sidebar block with one node that updates itself with an ajax call (clicking next in the pager)
then the page should NOT scroll at all i think.

Gurpartap Singh’s picture

it does NOT scroll to the page top. it scrolls to that view's top.

@merlinchaos Should be possible, but would be very tricky code for some cases.

merlinofchaos’s picture

If not, let's remove the scrollto altogether. I dislike it.

merlinofchaos’s picture

Status: Active » Fixed

http://drupal.org/node/284413 has a patch that fixes this some.

Gurpartap Singh’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jrefano’s picture

Category: feature » bug
Status: Closed (fixed) » Active

in ie8, all ajax pagers trigger a scroll to the top of the page. in firefox, safari and chrome, they trigger a scroll to the of the view that contained the pager you've clicked. anyone else seeing this?

dawehner’s picture

If this is a bug for you this should be a bug of jquery, which cannot be fixed from views.

iamjon’s picture

Status: Active » Closed (fixed)

marking this as closed