Code Monkey home page Code Monkey logo

Comments (5)

sstephenson avatar sstephenson commented on July 21, 2024 22

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.

leewaa avatar leewaa commented on July 21, 2024 17

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.

woto avatar woto commented on July 21, 2024

It helped me #20 (comment). Didn't found any drawbacks yet.

from turbo.

modusss avatar modusss commented on July 21, 2024

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.

jtoy avatar jtoy commented on July 21, 2024

ran into similar issue and stimulus is not the answer for me.

from turbo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.