Panel: Screen scrolls to top when updating panel #6688

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

Comments

Projects
None yet
4 participants
@mikkov

mikkov commented Nov 1, 2013

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

This comment has been minimized.

Show comment
Hide comment
Contributor

gabrielschulhof commented Nov 1, 2013

Yep, a regression: http://jsbin.com/ofuhaw/795

@rmcdaniel

This comment has been minimized.

Show comment
Hide comment
@rmcdaniel

rmcdaniel Nov 4, 2013

Contributor

If I comment out this line, the problem goes away:

window.scrollTo( 0, $.mobile.defaultHomeScroll );

Contributor

rmcdaniel commented Nov 4, 2013

If I comment out this line, the problem goes away:

window.scrollTo( 0, $.mobile.defaultHomeScroll );

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Nov 5, 2013

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.

Member

arschmitz commented Nov 5, 2013

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

This comment has been minimized.

Show comment
Hide comment
@rmcdaniel

rmcdaniel Nov 5, 2013

Contributor

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

Contributor

rmcdaniel commented Nov 5, 2013

@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

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Feb 18, 2014

Contributor

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.

Contributor

gabrielschulhof commented Feb 18, 2014

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.

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