Livewire component that provides you with a modal that supports multiple child modals while maintaining state.
The setActiveModalComponent is sometimes called multiple times resulting in issues with the component history log and could result in errors. This release prevents an already active modal component to be set active (while it is already active).
By default, closing a modal by pressing the escape key will force close all modals. If you want to disable this behavior to, for example, allow pressing escape to show a previous modal, you can overwrite the static closeModalOnEscapeIsForceful
method and have it return false
.
public static function closeModalOnEscapeIsForceful(): bool
{
return false;
}
When a modal is closed, you can optionally enable a modalClosed
event to be fired. This event will be fired on a call to closeModal
, when the escape button is pressed, or when you click outside the modal. The name of the closed component will be provided as a parameter;
public static function dispatchCloseEvent(): bool
{
return true;
}
Add option to disable closing modal on click a away:
public static function closeModalOnClickAway(): bool
{
return false;
}
Change Alpine binding to prevent VueJS conflict https://github.com/livewire-ui/modal/commit/85acc51047ca34a7b269939aff96e7abe665fcf1
Fixes #22
Allow emission of events with parameters and no target (https://github.com/livewire-ui/modal/commit/22e8e947a941ffe3e3cc23cdff460399d8673a7d)