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

[Feature request] Global flag to disable link hijacking within <turbo-frame>s by default #918

Closed
pilaf opened this issue May 2, 2023 · 2 comments

Comments

@pilaf
Copy link

pilaf commented May 2, 2023

This is in relation to #648 which made Turbo.session.drive only affect links outside of <turbo-frame> tags.

I think there is a use case for a flag that would also disable link hijacking within <turbo-frames> without having to set data-turbo="false" or target="_top" to all links within the frame tag. I maintain a large project that needs that behavior and I'm unable to upgrade Turbo because of this change.

Based on comments in that PR from @hidr0 and @guillaumewrobel it seems there's others who would benefit from such a flag as well.

Thank you.

Note: I had originally reported this as bug #826, closed since I realized it was not a bug.

@helhum
Copy link

helhum commented May 12, 2023

You can set data-turbo="false" not only on individual links but also to any parent DOM element, for which all child elements should have link hijacking disabled. This means, you can set the attribute to a frame tag <turbo-frame data-turbo="false"> to disable it for all links in a particular frame, or set <body data-turbo="false"> to disable it also for all frames on the page.

Does this do what you need?

@pilaf
Copy link
Author

pilaf commented May 15, 2023

@helhum That seems to work, thanks!

@pilaf pilaf closed this as completed May 15, 2023
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

2 participants