-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add ability to click link in a frame with a data-turbo-stream="true"
#1152
Add ability to click link in a frame with a data-turbo-stream="true"
#1152
Conversation
I'm afraid that this is the expected behavior. Turbo streams are not intended, in principle, to alter the browsing history, only to make changes to the DOM. At least that's how I understand it. So, it's possible to have a controller that reacts to a request that is in Turbo stream format, so that this controller responds with the Turbo stream actions that were requested by the call to the controller. But that controller is not necessarily prepared to receive normal HTML requests, so if you change the URL in the browser and a user, for example, refreshes the page, or simply clicks on a link and then goes back and caching is disabled on that page, will get a blank page. This could break many applications eventually. |
Sure, I got your point, what I should when I need to load some parts of html by turbo_stream, but it is filters page and I'd like to change url, 'cause when user refreshes page there is page without filters. So, what approach you recommend in this case? |
You can use |
But it's not relevant because I don't need turbo-frames, or just give me an example app. It should be page with filtering by url, like page respond to HTML to render whole page and turbo_stream to update parts of page with changing url to have applied filters to this page after reload |
The question is, why do you need Turbo streams for that? Isn't it a typical page navigation? Maybe with the replace action? |
What do you mean? Like it's typical page navigation but instead of reloading whole page to be navigated to next filtered page version,because of using turbo streams |
What I mean is that you could build these filters with typical form submissions and page navigations instead of Turbo streams using the replace action. That's why I'd like to better understand the use case you need. Even now with morphing there are more options to simplify it. Maybe with that we could suggest an alternative |
So, I guess it would be fine to have the ability to change the URL with turbo_stream request for some reason: when you have pagination or other type of request, like filters, you need to provide for user URL with its parameters, so in my case me too need. So, with this type of pages-request you'll update the page by parts with turbo_stream but it affects the URL, and the only way to solve it is to use JS code like stimulusUse with its mutate or create some workarounds that solve It by handling turbo events.
So, when contributors added the ability to create a
turbo_stream
with a GET request we also need the ability to show this GET request for the browser to add an ability for the user to share it, or find it, to be on the same page after page reloading. So, let me solve this problem, help or just complete this issue, pleasesolves #1151
solves #792