Skip to content
This repository

Wild scrolling occurs when hiding popup on WP7 #4784

Closed
dtabaka opened this Issue August 01, 2012 · 9 comments

5 participants

dtabaka Mat Marquis John Bender Gabriel "_|Nix|_" Schulhof Todd Parker
dtabaka

I tested the popups on http://jquerymobile.com/demos/1.2.0-alpha.1/#/demos/1.2.0-alpha.1/docs/pages/popup/index.html on a Samsung Focus Windows 7.5.

The popups work, but when I touch outside the popup to close it, the page does a complete refresh.

Gabriel "_|Nix|_" Schulhof
Collaborator

I don't think that's a refresh, but a really ugly page jump.

Gabriel "_|Nix|_" Schulhof
Collaborator

I don't really know what to do about this. For some reason, whenever I close the popup, and I'm assuming because of the window.history.back() that happens as part of the closing, for some reason, the browser jumps - on the popup/index.html page it jumps to (0,496) and on a simple page I created it jumps to (0,0). No idea why it does that, and I'm pretty sure it's not jQM doing it, because no window.scrollTo(x, y) code is executed when it happens.

Gabriel "_|Nix|_" Schulhof
Collaborator

I changed the summary to better reflect the problem.

Gabriel "_|Nix|_" Schulhof
Collaborator

I tried to save the current window coordinates before creating the new history entry, and setting the left and top from the retrieved coordinates for the starting history entry, and right after the hashchange also for the new history entry, to be sure that both history entries have the same (left,top) coordinate for the window.

This hasn't helped. It seems that, on WP, the $( window ).scroll{Left,Top}() associated with the history entry is recorded once when the page appears, and it cannot be updated by any means later. Then, when navigation causes a given page to be redisplayed, the coordinates from the history entry are looked up and the page is displayed at those coordinates.

This scrolling does not occur on either Android 2.3.5 or iOS 5.1.1 ...

dtabaka

Thank you for all your effort on this.

Todd Parker

Could this be caused by the focus moving from the popup to the origin?

dtabaka

I don't think so. If you download the Windows Phone 7.1 SDK, the Windows Phone Emulator gives a pretty accurate recreation of what I experience on the actual device.

Gabriel "_|Nix|_" Schulhof
Collaborator

... as does a Nokia Lumia 800.

Gabriel "_|Nix|_" Schulhof
Collaborator

I've had some really limited success fixing this with 5cc9723 ... the fix looks uglier than the problem :)

John Bender johnbender closed this in 46a65c6 August 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.