New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silentScroll on page refresh is called twice. #8200

Closed
vaso123 opened this Issue Jul 17, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@vaso123

vaso123 commented Jul 17, 2015

Hi!

The version I am using: http://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js

This will be a very long stroy, it has two parts. I am talking about a homepage, products are here, and a basket page, with the wanted products, and shipping method section.

1st issue:
When I scolling down, and down, down as the height of basket page, (for example, basket page height is 800, while I scrolled down to 2000), and click add to basket and go to basket, for some reason, I am the bottom of the basket page.

2nd issue: I select a shipping method, and I want after the page load to scroll to the shipping methods.
I am using this code, this is an inline js code in my basket page:

$(document).on("pagecontainershow", function (event, ui) {
    $.mobile.silentScroll($('#basketbottom').offset().top);
});

The problem is, when I refresh the page, it is scroll down to the $('#basketbottom') but immediatly scroll back to the top of the page.

I've downloaded and debugged the jQuery mobile js file, and see, the silentScroll is called twice. First, ypos has the given float number, where the y position of the $('#basketbottom'), but second, that is an object. This is why first is scroll down to the right place, but second go back to top.

The second call is coming from the line 15433.

Just set the $.mobile.hideUrlBar is not an option, because there are side effects, what leads to the issue 1.

My solution was to comment out the line 15433, and both of the issues are solved.

I know, this is not the regular way to report an issue, but it is a really complex problem. You can read more about it here: http://stackoverflow.com/questions/31474402/after-jquery-mobile-pageshow-silentscroll-page-jumps-to-top/31477373#31477373

If you need any further information, you have questions, notices, please comment it.

@Sonali-Goyal

This comment has been minimized.

Show comment
Hide comment
@Sonali-Goyal

Sonali-Goyal Mar 3, 2016

Contributor

Hello I am Sonali Goyal from India I am participating in GSOC 2016 and would like to work on this bug as a part of it.

Contributor

Sonali-Goyal commented Mar 3, 2016

Hello I am Sonali Goyal from India I am participating in GSOC 2016 and would like to work on this bug as a part of it.

@vaso123

This comment has been minimized.

Show comment
Hide comment
@vaso123

vaso123 May 25, 2016

Thank you for your time and for your job. Open source, and such an enthusiastic like you are move the world something better towards.

vaso123 commented May 25, 2016

Thank you for your time and for your job. Open source, and such an enthusiastic like you are move the world something better towards.

@apsdehal

This comment has been minimized.

Show comment
Hide comment
Member

apsdehal commented May 25, 2016

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jun 17, 2016

Hi,

I'm having a similar problem where my app jumps back to the top of the page when data has been pulled from database, and so a refresh is being initiated I presume.

If this fixes it, how would I go about getting it? I'm using the min.js, and have no idea how to implement this fix in my already existing library version.

ghost commented Jun 17, 2016

Hi,

I'm having a similar problem where my app jumps back to the top of the page when data has been pulled from database, and so a refresh is being initiated I presume.

If this fixes it, how would I go about getting it? I'm using the min.js, and have no idea how to implement this fix in my already existing library version.

arschmitz added a commit to arschmitz/jquery-mobile that referenced this issue Jul 4, 2016

@apsdehal apsdehal self-assigned this Aug 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment