Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo frame action "advance" is ignored #48

Open
nunesmatheus opened this issue Nov 22, 2024 · 0 comments
Open

Turbo frame action "advance" is ignored #48

nunesmatheus opened this issue Nov 22, 2024 · 0 comments

Comments

@nunesmatheus
Copy link

Hey, thanks for this amazing project. It really makes me excited about web development again!

Bug

As I was using it to build my first iOS application, I noticed a bug that causes my application to work like this:

  1. Go to a page that supports pagination
  2. Click a pagination link to go the next page (page 2)
  3. Refresh the page
  4. Result: the refreshed page is page 1
  5. Expected result: the refreshed page is page 2

I think this happens because I'm using <turbo-frame> with data-turbo-action attribute as "advance" and it is not being respected, so the navigation works fine, but the URL doesn't change and a refresh sends us back to the initial page that rendered the original turbo-frame.
Basically, I'm expecting this to work natively as well, so correct me if I'm wrong on that assumption: https://turbo.hotwired.dev/handbook/frames#promoting-a-frame-navigation-to-a-page-visit.

Steps to reproduce

  1. Run an app that has a turbo-frame with navigation promoted to page visit
  2. Open the demo app from this repo on Xcode, point to the application from above and run it
  3. Navigate to a page that has pagination
  4. Go to the next page
  5. Pull to refresh the page and see it go back to the previous page instead of refreshing the current page

I created this tiny Rails app that can be used to test it: https://github.com/nunesmatheus/turbo-frame-promote-visit-demo.

I just ran rails new and added a simple page with pagination links inside a turbo frame that promotes navigation to page visits: nunesmatheus/turbo-frame-promote-visit-demo@950dcd9.

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

No branches or pull requests

1 participant