5

I'm using an event handler to go to the previous URL/route:

'click #back': ->
  history.back()

This works in Chrome desktop, Chrome devtools mobile device view, and in Safari on a physical device itself (iOS 8.1.2), but not in Chrome on the device. Behavior is:

  • Load /
  • Click link to /foo
  • URL changes to /foo, and foo template renders
  • Click #back
  • URL changes to / briefly, then changes back to /foo. The page body does not change. (Correct behavior is the URL permanently changes to /, and the / templates are rendered, without a page load.)
  • Click #back second time
  • / is reloaded from server

Is this a mobile Chrome problem, or should I be using some iron-router API like Router.back()?

Loren
  • 13,903
  • 8
  • 48
  • 79
  • 2
    Using `history.back()` [should work](https://github.com/EventedMind/iron-router/issues/48) (at least some years ago :P). – Peppe L-G Dec 13 '14 at 04:36

1 Answers1

6

history.back() is the method supported by iron-router, it just appears there's a problem with iOS Chrome.

Loren
  • 13,903
  • 8
  • 48
  • 79