fix close buttons in modals
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<flux:modal wire:model="showAddMembersModal" class="w-full max-w-xl">
|
||||
<flux:modal wire:model="showAddMembersModal" :closable="false" class="w-full max-w-xl">
|
||||
<form wire:submit="addMembers" class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg">{{ __('Add people') }}</flux:heading>
|
||||
@@ -258,7 +258,7 @@
|
||||
</form>
|
||||
</flux:modal>
|
||||
|
||||
<flux:modal wire:model="showFilesModal" class="w-full max-w-2xl">
|
||||
<flux:modal wire:model="showFilesModal" :closable="false" class="w-full max-w-2xl">
|
||||
<div class="space-y-6">
|
||||
<div class="flex items-start justify-between gap-4">
|
||||
<div>
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
</flux:dropdown>
|
||||
</div>
|
||||
|
||||
<flux:modal wire:model="showCreateConversationModal" class="w-full max-w-2xl">
|
||||
<flux:modal wire:model="showCreateConversationModal" :closable="false" class="w-full max-w-2xl">
|
||||
<form wire:submit="createConversation" class="space-y-6">
|
||||
<div class="flex items-start justify-between gap-4">
|
||||
<div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</flux:button>
|
||||
</flux:modal.trigger>
|
||||
|
||||
<flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" focusable class="max-w-lg">
|
||||
<flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" :closable="false" focusable class="max-w-lg">
|
||||
<form method="POST" wire:submit="deleteUser" class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg">{{ __('Are you sure you want to delete your account?') }}</flux:heading>
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
<flux:modal
|
||||
name="two-factor-setup-modal"
|
||||
class="max-w-md md:min-w-md"
|
||||
:closable="false"
|
||||
@close="closeModal"
|
||||
wire:model="showModal"
|
||||
>
|
||||
|
||||
18
tests/Feature/ModalChromeTest.php
Normal file
18
tests/Feature/ModalChromeTest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
test('flux modals hide the built in top right close button', function () {
|
||||
$modalDeclarations = collect([
|
||||
resource_path('views/livewire/chat/conversation-details-panel.blade.php'),
|
||||
resource_path('views/livewire/chat/conversation-list.blade.php'),
|
||||
resource_path('views/livewire/settings/delete-user-form.blade.php'),
|
||||
resource_path('views/livewire/settings/security.blade.php'),
|
||||
])->flatMap(function (string $path): array {
|
||||
preg_match_all('/<flux:modal(?![\\w.-])(?:[^"\'>]|"[^"]*"|\'[^\']*\')*>/s', file_get_contents($path), $matches);
|
||||
|
||||
return $matches[0];
|
||||
});
|
||||
|
||||
expect($modalDeclarations)->not->toBeEmpty();
|
||||
|
||||
$modalDeclarations->each(fn (string $declaration) => expect($declaration)->toContain(':closable="false"'));
|
||||
});
|
||||
Reference in New Issue
Block a user