wire-elements / modal

Livewire component that provides you with a modal that supports multiple child modals while maintaining state.
MIT License
1.09k stars 129 forks source link

The screen is blurred due to multiple button clicks within a short time. #431

Closed nenadsijan closed 3 months ago

nenadsijan commented 3 months ago

Hi PhiloNL I am using LIvewire 3, TailwindCSS and your package Wire Elements Pro. Error: An error occurs in the browser console if the button to open a modal class is clicked multiple times within a short period of time, Error is(Uncaught (in promise) Component not found: ZlYcx1wKYe0dQDAOEZ4j). In the next step when we want to close the modal $dispatch('modal.close'), the screen is blurred.

Here are the steps:

1.Multiple button clicks within a short period of time<button type="button" wire:click="$dispatch('modal.open', {component: 'modals.edit-item', arguments: {id: 1}"></button>

  1. Modal is open, but we get error in the browser console __Uncaught (in promise) Component not found: ZlYcx1wKYe0dQDAOEZ4j__
  2. Clicking on the button to close the modal wire:click="$dispatch('modal.close')"
  3. The screen is blurred

Thanks in advance Nenad

PhiloNL commented 3 months ago

This should be fixed in v4.0.14, please make sure you use wire:modal instead, for example:

<button wire:modal="modals.edit-item, @js(['id' => 1])">Open</button>
nenadsijan commented 3 months ago

Dear @PhiloNL I upgraded to Wire Elements Pro to version 4.0.14 But I still get the same error when button to open a modal class is quickly clicked multiple times Here are the steps:

  1. Multiple clicks on the button within a short period of time<button type="button" wire:modal="modals.edit-item, @js(['id' => 1])">Test button</button>
  2. Modal is open, but still there is a error in the browser console Uncaught (in promise) Component not found: e3HrnW0Ja54bVYzKjS8
  3. Clicking on the button to close the modal wire:click="$dispatch('modal.close')"
  4. The screen is blurred

Maybe would be good that the button is disabled during opening event. I tried to do that with wire:loading.attr="disabled" but it not helps BR Nenad

nenadsijan commented 3 months ago

Dear @PhiloNL , Sorry for the inconvenience, it was my mistake. I forgot to execute php artisan config:clear after composer update It works perfect now :) Thanks a lot Nenad