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 loads twice when it is in the response of a redirected request #526

Closed
karthikkasturitg opened this issue Feb 2, 2022 · 2 comments

Comments

@karthikkasturitg
Copy link

Using turbo-rails with turbo-frame :

Assuming there is a page with an anchor that links to "/page" and the /page action redirects to "/main" where we have a response of .html.erb as such: Frame here:

Expected behavior: On clicking the link to /page, main.html.erb should be loaded and since the response has a turbo frame, "/test/frame" should be called once to load the data for the frame

Actual behavior: "/test/frame" is called twice.

Can be replicated on: https://github.com/karthikkasturi/turbo-frame-loads-twice-on-redirect

@blrB
Copy link
Contributor

blrB commented Feb 12, 2022

I think it is a duplicate of issue #515 and PR #516 will resolve this issue.

@dhh
Copy link
Member

dhh commented Jun 19, 2022

Solved via #516

@dhh dhh closed this as completed Jun 19, 2022
seanpdoyle added a commit to seanpdoyle/turbo that referenced this issue Nov 27, 2023
Closes [hotwired#526][]

Prevent naming collisions between the new `Turbo.fetch` function and the
built-in `window.fetch` function.

To do so, create a module-local reference to `window.fetch`, and define
the exported function as `fetchWithTurboHeaders`. At export-time, rename
to `fetch` so that consumers can continue to import it as `Turbo.fetch`.

[hotwired#526]: hotwired/turbo-rails#526
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

3 participants