New Discussion

Notifications

You’re not receiving notifications from this thread.

Message Form Handling with Stimulus Discussion

4
General

Why not using stimulus data-action="keypress->conversation#submitForm" on text area instead of addEventListener?

Funny you should say that because in the next video (spoiler alert!), where we add some more stimulus, I refactor our code to do this but still with the keydown event.

oh, i see :D

It is better than putting the function call directly at the end of cookie clicker the body, because load event is guaranteed to fire after all resources are loaded.

Good point! Ensuring the load event fires after all resources are loaded definitely improves reliability.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 89,509+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.