flowbite
flowbite copied to clipboard
Reinitialize properly on Form Validation Errors for Turbo
In the current integration, the turbo:load event doesn't capture every Turbo render—for example, forms that fail validation (returning a 422 status) aren't caught. Instead, turbo:render handles those cases and also covers all events that turbo:load does, except for the initial page load. To address this, I use DOMContentLoaded to ensure the initial load is handled properly.