-
Notifications
You must be signed in to change notification settings - Fork 441
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
data-turbo-action
doesn't play well with data-turbo-stream
?
#683
Comments
Hey @ernsheong, thanks for opening this issue! I'm not sure I'm following 100%. Do you have something like <a href="/route-that-returns-stream-actions" data-turbo-stream data-turbo-action="advance">Click me</a> and expect your browser URL to be If so, that's not how the |
Thank you so much for your response, @marcoroth. Yes it makes sense that this is not how it is intended to be used. I will need to rethink my approach :) Ultimately either a maintain scroll solution or a |
@ernsheong I'm a bit late to the show, but this is how I managed to work it out: #792 |
Any chance this behaviour is coming soon? I need to be able to advance a URL while also returning a stream. Not sure why this isn't intended as it is something that would need to be set on a specific link. |
Echoing @trsteel88 sentiments: firing a visit while rendering a stream can be a logical approach. In my current project, I have nav links that update the central page component (i.e. registering a visit is logical and justified) via stream. The controller action that calls this turbo stream has a full page render for direct navigation. The current thinking is forcing me to choose between the use of streams and good UX navigation. In contrast, turbo frames can trigger visits while only updating portions of a page. I fail to see a difference between that and implementing similar outcomes via streams. |
Adding myself to the list of people who would gain a lot from this! 😄 |
I want the URL to advance for Turbo stream GET request as well. Is there's a plan for this to be added? |
Another use case (just happened here): search-as-you-type form that submits via GET. I need to update 3 places: top pagination info, bottom pagination nav, and results themselves. Preferably I do all 3 via turbo_stream. The url should be changing as the query is being entered, with Edit: I implemented a turbo-frame that ships turbo-stream templates alongside it, and it works. However, now I have an awkward partial that contains the whole |
I've also just been bitten by this. I had a page with a search form frame that targets a results frame. Changing search filters triggered an update to the results with an action=advance. I then needed to also update some stats in a sidebar so swapped from a standard HTML response to a turbo_stream response with two replace actions for the two frames and ran into this problem that the URL stopped updating and navigation back from a search result led to incorrect results being shown. It feels a reasonable use case to support IMO. The stream action tag inside a single frame response suggested by @maxim seems to work for me, but it feels pretty hacky. |
Apologies in advance, this could either be a question or a bug.
Version: 7.2.0-beta.2
I am noticing that if I use
data-turbo-stream
on a GET link (a new feature), it doesn't do anything withdata-turbo-action="advance"
, ie the URL does not update in the browser. Is this expected behavior or a bug?If expected, what is the way I should approach if I want a GET link click to change multiple parts of my page? No choice but Stimulus?
The text was updated successfully, but these errors were encountered: