pushState is broken on certain browsers #5414

Closed
jaspermdegroot opened this Issue Jan 3, 2013 · 8 comments

Projects

None yet

5 participants

@jaspermdegroot
Member

Issues:

  • Nav back: The browser does not respond when you click the browser back button or a link with data-rel="back" for the first time (link enhanced as button does get active and focus style). If you click a second time it navigates back two pages in history.
  • Popup: A button that links to a popup gets the active and focus style and #&ui-state=dialog is appended to the url, but the popup doesn't open.

Test page:
http://jquerymobile.com/test/
http://jquerymobile.com/test/docs/pages/popup/index.html

Tested on:

  • IE10 / Win8
  • Opera Desktop 12.12 / Win7
  • Opera Mobile 12.10 / Android 4.1
  • Chrome 23.0.1271.100 / iOS 6.0.1
@jaspermdegroot
Member

The issues don't occur with $.mobile.pushStateEnabled = false;.

@jaspermdegroot
Member

Although the behaviour is a bit different this seems to be the same issue as reported for iOS6 #5401

@jerone
Contributor
jerone commented Jan 3, 2013

Two issues with Opera Desktop 12.11 & 12.12:

  1. Confirmed that popups don't work, just as state above.
  2. Back button doesn't work on docs:
    a. Open http://jquerymobile.com/test/docs/pages/popup/index.html on new tab
    b. Press the docs "home" button.
    c. Press browser back button; see url go back to http://jquerymobile.com/test/docs/pages/popup/index.html, but page won't change.
@gabrielschulhof
Contributor

The scenario described by @jerone can be generalized as follows:

Given a history of pages a -> b -> c -> d -> e, if you go back d <- e, the location changes but the page does not. If you then go back again (c <- d) and again (b <- c), and again, until you're supposed to be back on a, you will find that it works. Only the first backwards step is broken.

Behind the scenes, the first backwards step does not result in a "navigate" event (to which the function _handleHashChange is attached, which ultimately changes the page), whereas subsequent backwards steps do result in a "navigate" event.

@johnbender
Contributor

@gabrielschulhof

I'll take a look too. My guess is that one of the locks isn't disabled or similar.

@gabrielschulhof
Contributor

FWIW, Opera/Linux does not trigger a popstate event when clicking a link to a perfectly normal page whereas Chrome/Linux does.

@Wilto Wilto was assigned Jan 3, 2013
@johnbender johnbender closed this in 6602c21 Jan 8, 2013
@johnbender
Contributor

@gabrielschulhof @uGoMobi

Would either of you mind verifying this works in your environments?

@jaspermdegroot
Member

@johnbender

I tested latest on Opera and IE10 and I cannot longer reproduce the issue. Great!

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