Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
Next Chapter

Challenge #1 of 1


Q: 

I was going through my site's JavaScript and I saw this piece of code in app.js:

document.addEventListener('turbo:submit-start', (event) => {
    event.detail.formSubmission.submitter.classList.toggle('loading');
});

This must be the code responsible for adding a loading state to the buttons in my forms!

How does the Turbo event turbo:submit-start work?

userVoice