turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

Forward/Back button issue #607

Closed alexhanh closed 8 years ago

alexhanh commented 9 years ago

Rails 4 with Turbolinks. Here are the steps to replicate:

  1. Navigate to /home
  2. Click new post and go to /posts/new
  3. Make a submit with validation error, still on /posts/new
  4. Fix input and successfully post, now on /posts
  5. Press browser's back button, now on /posts/new
  6. Press browser's forward button, now on /posts
  7. Press browser's back button

And voila, I end up in /home instead of /posts/new. Is this intended or a possible bug?

Thibaut commented 8 years ago

Do you have a link to an app where we can replicate?

alexhanh commented 8 years ago

@Thibaut I added a simple Rails app you can test https://github.com/alexhanh/turbolinks_nav_test

  1. Navigate to root localhost:3000
  2. Click new post and go to /posts/new
  3. Make a submit with validation error by submitting empty form, still on /posts/new
  4. Fix input (fill author and body) and successfully post, now on /posts/1
  5. Press browser's back button, now on /posts/new
  6. Press browser's forward button, now on /posts/1
  7. Press browser's back button

And we end up in /posts instead of /posts/new. Not identical to the original, but still the hierarchy seems to be broken, since I believe it should be / > posts/new > posts/1.

Thibaut commented 8 years ago

Thanks. Could you try using Turbolinks 3 / master?