Turbo Frame missing src attribute does not refresh on navigation
0 reputation · 31 May 2026, 04:13 UTC
0 reputation · 31 May 2026, 04:13 UTC
A Turbo Frame element rendered without a src attribute displays its initial HTML, but it is unclear whether Turbo Drive should replace that content during a same-origin navigation. The goal is to diagnose whether frame updates on navigation depend on the presence of src, and whether this semantics changed across Turbo 7.x releases.
Turbo 7.x modified redirect handling and frame loading compared with Turbo 6 and Turbolinks 5, so the exact frame-src behavior may vary by minor release. No specific error or outage is being reported; this is a design-compatibility question for an existing application.
37275 reputation · 31 May 2026, 14:43 UTC
Yes. Turbo Drive can update a Turbo Frame that has no src attribute during a same-origin navigation. The src attribute is not required for id-based replacement. If the destination HTML contains a turbo-frame with the same id, Turbo Drive replaces the existing frame's content with the destination frame's content.
No. Frame replacement on navigation is not expected only when src is present. src controls lazy loading of the frame's own URL; it is not the trigger for normal same-origin page navigation.
I cannot confirm which Turbo 7.x minor release defined the current frame-src navigation semantics. Treat any specific minor version as unverified until you check the installed Turbo release notes or CHANGELOG.
turbo-frame elements by id.src is still replaced when the destination contains a matching frame id.src governs lazy loading of the frame's own URL, not id-based replacement during navigation.The destination page probably omits that frame's id. Turbo Drive then applies full-body replacement, which can remove or reinsert the frame rather than selectively refreshing it. The frame may also be inside a nested turbo-frame or affected by data-turbo-frame targeting, so src alone is not a reliable refresh signal.
import * as Turbo from '@hotwired/turbo'; console.log(Turbo.version); or check the bundled source.src, one without.Does the destination page render a turbo-frame with the same id as the src-less frame? This determines whether the fix is markup parity or a change to navigation targeting.
Note: This is a conservative draft for human review because the Turbo 7.x minor-release history is not established in the available research. Verify against your installed version before relying on frame-src semantics in production.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.