Panel: Screen scrolls to top when updating panel #6688

Closed
mikkov opened this Issue Nov 1, 2013 · 5 comments

Projects

None yet

4 participants

@mikkov

With Jquery Mobile 1.4.0-rc1 updating panel with $( "#mypanel" ).trigger( "updatelayout" ) causes screen to scroll to top. This did not happen with version 1.3.x

  1. Open test page http://jsbin.com/ofuhaw/789
  2. Open panel
  3. Add new lines to the panel until you can scroll
  4. Scroll down a bit
  5. Add a new line
  6. Screen scrolls automatically to top
@arschmitz
jQuery Foundation member

If you comment out the one line that scrolls to top it wont scroll to top. This line is there for a reason and does exactly what is intended. The real question is why is the positionPanel method being called in this case when it should not be.

@rmcdaniel

@arschmitz Sorry, I'm just helping narrow down in the code where the problem occurs. If my comments aren't helpful then I won't make them.

@gabrielschulhof gabrielschulhof modified the milestone: 1.4.2, 1.4.1 Feb 13, 2014
@gabrielschulhof

The panel calls _positionPanel() intentionally upon updatelayout to fix #5535. Perhaps it does not need to scroll to top. Perhaps _positionPanel() can be broken up into multiple functions, only some of which are called from updatelayout.

@gabrielschulhof gabrielschulhof added a commit to gabrielschulhof/jquery-mobile that referenced this issue Feb 18, 2014
@gabrielschulhof gabrielschulhof Panel: Do not scroll to top upon updatelayout
Fixes gh-6688
b32ecea
@gabrielschulhof gabrielschulhof self-assigned this Feb 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment