Wild scrolling occurs when hiding popup on WP7 #4784

Closed
dtabaka opened this Issue Aug 1, 2012 · 9 comments

5 participants

@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.

@gabrielschulhof

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

@gabrielschulhof

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.

@gabrielschulhof

I changed the summary to better reflect the problem.

@gabrielschulhof

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.

@toddparker

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

@Wilto Wilto was assigned Aug 9, 2012
@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.

@gabrielschulhof

... as does a Nokia Lumia 800.

@gabrielschulhof

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

@arschmitz arschmitz added a commit to arschmitz/jquery-mobile that referenced this issue Oct 16, 2012
@johnbender johnbender disable popup history managment in old ie by default, Fixes #4784 846fefb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment