Comments (5)
We don't plan on adding an after-stream-render event: https://discuss.hotwire.dev/t/event-to-know-a-turbo-stream-has-been-rendered/1554/6
from turbo.
I don't understand why there is no plan in adding a turbo:after-stream-render
event? Could someone care to explain?
Picture this wizard:
- Each step in the wizard has a form.
- Each form is validated server-side, responding with turbo-stream
- On failure, form is replaced in the DOM with the newly rendered one containing errors.
- On success, the next step in the wizard is presented to the user by a fade-in/out animation.
How can I do this without that event and only turbo with a bit of JS for the animation? It feels like Stimulus overly complicates it for something that would otherwise be pretty straightforward?
Hooking into the form submit with stimulus feels painful and breaks the regular rails flow of things. (for rails apps using turbo)
IMO the flow should be: form submit --> rails action --> DOM updated (or stimulus hook action)
not: form submit -> stimulus acton -> rails action -> stimulus action -> dom updated
from turbo.
It helped me #20 (comment). Didn't found any drawbacks yet.
from turbo.
The big problem in my case is that after turbo_stream is loaded, the javacript library input_mask doesn't work anymore because the content that changes is the form itself.
They brought to us a solution with Stimulus and "connect()" method b but it does not trigger after turbo stream is loaded.
There is nothing that triggers after page changes.
from turbo.
ran into similar issue and stimulus is not the answer for me.
from turbo.
Related Issues (20)
- Turbo Stream refresh does not work when responding to a form submission HOT 1
- InstantClick is incompatible with `data-turbo-stream` and `data-turbo-confirm` HOT 1
- InstantClick always fetches page when hovering same link within the turbo-prefetch-cache-time window. HOT 5
- Morphing between different URLs HOT 1
- Morphed Turbo frame keeps loading the same content when `turbo_frame: :_top` is used to exit it HOT 2
- Event turbo:before-render is fired twice, unless caching is disabled. HOT 7
- Support `data-turbo-frame="_parent"` in nested frames
- Morphing is updates an `a` tag, but not it's content, but only on the client who initiated the action HOT 10
- Navigating to page with non-successful response seems to reload javascript HOT 9
- Turbo doesn't send Turbo-Frame header when frame's src is updated HOT 13
- Morphing: impossible to "clear" a form due to ignoreActiveValue: true HOT 9
- Morphing overwrites the user's input on active element HOT 4
- Turbo 8 link advance with frame and temporary not render
- Progress bar does not disappear after fast network response HOT 2
- Turbo 8 data-turbo-action=advance and turbo stream replaces head section HOT 2
- InstaClick does not work when use frame to same page
- Turbo stream refresh takes precedence over user interaction HOT 3
- Turbo morph not preserving stimulus values HOT 1
- Turbo morph displays progress bar HOT 2
- [QUESTION] Plans for turbo handle routes? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbo.