Enhance button and form interaction handling to prevent conflicts with Livewire and Alpine states
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user