Stimulus Controller to help with Shoelace form submissions

Hey, in case there are folks out there scratching their heads over how to get Shoelace Form components and Turbo working well together, I put together a Stimulus controller that seems to do the job.

Basically it takes Shoelace’s custom submit event, copies values into new hidden form elements and submits the form, then resets the form after the Turbo response finishes. Also does a nice little “loading” state trick for the Shoelace submit button.

1 Like