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

Modal Opening Twice #375

Closed GBry closed 8 months ago

GBry commented 8 months ago

My modal opened twice on one event of the emit (now Dispatch because livewire 3.x, but also happens in 2.x) The front one doesn't fire functions at all but is clickable, the one behind fires functions but not correctly and only clickable when the front one is dismissed, like the picture here: image

The front one gets locked to the bottom too. I replaced align-bottom with align-middle in the modal.blade.php but now after upgrading it's stuck to the bottom

Edit: Sometimes there's an overlay like the picture here: image

Edit 2 : Weirdly enough the modal at the back is the one registered in the Livewire Devtools image

I have read somewhere that we can put wire:key, but since we are using events to open a modal, how do we solve this?

Thanks!

My composer.json "require": { "php": "^8.1", "doctrine/dbal": "^3.6", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.0", "laravel/sanctum": "^3.2", "laravel/tinker": "^2.8", "livewire/livewire": "^3.0", "maatwebsite/excel": "^3.0", "mkocansey/bladewind": "^2.1", "openspout/openspout": "4", "orangehill/iseed": "^3.0", "power-components/livewire-powergrid": "^5.1", "spatie/laravel-permission": "^5.10", "wire-elements/modal": "^2.0", "wireui/wireui": "^v1.18" },

GBry commented 8 months ago

Update : A powergrid table is present on the page of the problem, I think Alpine is being called twice

GBry commented 8 months ago
@livewire('wire-elements-modal')   imported twice.

Both in app layout, and in pages containing the modal. Deleting either one solved it, I deleted the one in the app layout