hotwired / hotwired/turbo

Head merge issue with turbo frame navigation promoted to a page visit

Open
#1,237 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.4k
Forks
491
Avg merge
1d 16h
Merged PRs (30d)
4

Description

When using the data-turbo-action="advance" attribute the document's head is merged. (Handbook)
During that process meta-tags are removed from the head if the response's head doesn't include them. That includes meta-tags that may be required such as csrf-token or vapid-public-key.

I ran into this issue when using the custom layout provided by turbo-rails.

Thank you

Gems:
turbo-rails (2.0.5)

Packges:
@hotwired/turbo-rails@^8.0.4
@hotwired/turbo@^8.0.4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the Frames handbook section on promoting a frame navigation to a page visit, then reproduce the behavior with the turbo-rails custom layout at app/views/layouts/turbo_rails/frame.html.erb and data-turbo-action="advance". Trace the head merge behavior and verify that required meta-tags such as csrf-token and vapid-public-key are retained when absent from the response head.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.