Start your All-Access Pass to unlock this challenge
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?