Enhance button and form interaction handling to prevent conflicts with Livewire and Alpine states

This commit is contained in:
2026-02-02 17:28:39 -05:00
parent 19ccfaa27f
commit 22b7bbe780
2 changed files with 56 additions and 2 deletions

View File

@@ -329,6 +329,15 @@
}
document.addEventListener('click', function(e) {
// Skip Livewire/Alpine handled buttons - they manage their own loading states
if (e.target.hasAttribute('wire:click') ||
e.target.hasAttribute('wire:submit') ||
e.target.hasAttribute('x-on:click') ||
e.target.hasAttribute('@click') ||
e.target.closest('[wire\\:submit]')) {
return;
}
if (e.target.matches('button[type="submit"], .btn-submit')) {
e.target.classList.add('btn-loading');