iOS scroll position history broken in A4 #1342

Closed
tavelli opened this Issue Apr 1, 2011 · 9 comments

Projects

None yet

6 participants

@tavelli
tavelli commented Apr 1, 2011

Was working great in A3, still works in chrome on my iMac.

to reproduce:

Device: iPhone 3GS, iOS 4.3

@toddparker
Contributor

This must have been a last minute regression. Bumping this to a blocker. Thanks for reporting.

@scottjehl
Contributor

Okay so this was introduced when I moved the "listbox" role and related focus management out of listview and into select (where that role and management makes sense). Otherwise, we had tabindex attrs on all listview LIs, and that seemed to prevent iOS from jumping to them on focus. Now that LIs have no tabindexes, the anchors are findable and iOS scrolls to them instead of the previous scroll location.

@scottjehl
Contributor

To ensure focus and scrollTo don't conflict (when possible), I set the focus order on page show to 1) previously clicked item if revisiting that page 2) page title 3) first focusable item in the page. Closed by 97f5a95

@scottjehl scottjehl closed this Apr 7, 2011
@eddiemonge
Contributor

This should be reopened since it breaks the example at jquery-mobile/index.html.
If you try to switch the theme, the page tries to scroll to a hidden element and scrolls overflow elements causing the page layout to break.

it just breaks accessibility

We need it ... we just have to make the timing predictable/correct

for example, the silentScroll() done near it is an async scroll

so if the focus happens before the scroll we'll get this problem

in theory we need to 1. Flush Rendering (so everything is sized properly)

  1. Scroll to the previous position
  2. Set focus

unfortunately right now 1 and 2 are async

we need to fix that

@toddparker toddparker reopened this Apr 12, 2011
@toddparker
Contributor

Agreed. I just re-opened.

@jblas jblas was assigned Apr 12, 2011
@ray58750034 ray58750034 pushed a commit that referenced this issue Apr 16, 2011
scottjehl To ensure focus and scrollTo don't conflict (when possible), I set th…
…e focus order on page show to 1) previously clicked item if revisiting that page 2) page title 3) first focusable item in the page. Fixes #1342
97f5a95
@ray58750034 ray58750034 pushed a commit that referenced this issue Apr 16, 2011
@eddiemonge eddiemonge Merge branch 'master' of https://github.com/jquery/jquery-mobile into…
… fr_1177

* 'master' of https://github.com/jquery/jquery-mobile:
  [astounding] fixed css that locked ie in the navigation unit tests. tagged so I can show my kids some day
  Fix for issues:
  set version to 1.0a4.1
  wrapped the else if/else in an else to prevent an unnecessary dom walk until we have to make it.
  To ensure focus and scrollTo don't conflict (when possible), I set the focus order on page show to 1) previously clicked item if revisiting that page 2) page title 3) first focusable item in the page. Fixes #1342
dbdb6c5
@scottjehl
Contributor

This fix landed in the navigation refactor. Focus waits for silentScroll's event to fire now. Thanks!

@scottjehl scottjehl closed this Jun 20, 2011
@eirikhm
eirikhm commented Aug 22, 2011

This issue is still valid for http://jquerymobile.com/test/ for iOS 4.1. For 4.3.2 it seems to work, but it loads the previous page scrolled to top, then pops down.

@scottjehl scottjehl reopened this Aug 22, 2011
@scottjehl
Contributor

Yep. Thanks. We've got a branch about ready to land that'll fix it again.

@scottjehl
Contributor

Okay! This is fixed again in master. Thanks for keeping on it :)

@scottjehl scottjehl closed this Sep 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment