hotwired / turbo

The speed of a single-page web application without having to write any JavaScript
https://turbo.hotwired.dev
MIT License
6.73k stars 428 forks source link

Turbo does not update URL with nested frames #699

Open manuelpuyol opened 2 years ago

manuelpuyol commented 2 years ago

Commit with example

It's kinda specific, but if you have a structure like:

<turbo-frame id="tab-frame-outer" data-turbo-action="advance" target="_top">
  <a data-turbo-frame="tab-frame" id="bug-1" href="/src/tests/fixtures/bug/two.html">Link</a>

  <turbo-frame id="tab-frame" data-turbo-action="advance" target="_top">
    <div id="tab-content">One</div>
  </turbo-frame>
</turbo-frame>

where an outer turbo-frame wraps links that point to the inner turbo-frame, Turbo won't update the URL when clicking on the link

https://user-images.githubusercontent.com/11280312/187282168-a9a2b203-b1cf-432b-aae8-63e3f872a603.mov

Cervenka commented 2 years ago

I am seeing the same issue. I am using a nested turbo-frame to lazy-load a contact list in a chat application. Also applying the attribute data-turbo-action="advance" directly to the anchor does not solve the issue.

Have you come up with a good alternative solution?

manuelpuyol commented 2 years ago

I haven't come up with any solution :/

gjtorikian commented 2 years ago

Thanks for reporting this—I just hit it in our app, too. 😦

willcosgrove commented 2 years ago

I was running into this problem as well, and it was fixed for me with #749. Hopefully a new release can come out soon.

mackermedia commented 1 year ago

I'm running into this issue too, and the latest main branch w/ #749 included does not fix it.

Has anyone else having the issue tried that potential fix yet?

nepalez commented 8 months ago

Same problem