From 292ac8b544acf41159bf4372b4dd688fc97eecd7 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 25 Sep 2024 06:22:31 +0100 Subject: [PATCH 1/2] FixLoadingPlaceholderBug --- resources/views/components/includes/loading.blade.php | 8 ++++---- resources/views/components/table/tr.blade.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/components/includes/loading.blade.php b/resources/views/components/includes/loading.blade.php index c07d9cb19..99875b741 100644 --- a/resources/views/components/includes/loading.blade.php +++ b/resources/views/components/includes/loading.blade.php @@ -9,15 +9,15 @@ @include($this->getLoadingPlaceHolderBlade(), ['colCount' => $colCount]) @else - merge($customAttributes['loader-wrapper']) - ->class(['w-full text-center h-screen place-items-center align-middle' => $isTailwind && ($customAttributes['loader-wrapper']['default'] ?? true)]) - ->class(['w-100 text-center h-100 align-items-center' => $isBootstrap && ($customAttributes['loader-wrapper']['default'] ?? true)]); + ->class(['hidden w-full text-center h-screen place-items-center align-middle' => $isTailwind && ($customAttributes['loader-wrapper']['default'] ?? true)]) + ->class(['d-none w-100 text-center h-100 align-items-center' => $isBootstrap && ($customAttributes['loader-wrapper']['default'] ?? true)]); }} wire:loading.class.remove="hidden d-none" > - +
hasDisplayLoadingPlaceholder()) - wire:loading.remove + wire:loading.class.add="hidden d-none" @else - wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60" + wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60" @endif id="{{ $tableName }}-row-{{ $row->{$primaryKey} }}" :draggable="currentlyReorderingStatus" From 79227b0fc1f986fc8a48f6c31a6f7ac83c8430cf Mon Sep 17 00:00:00 2001 From: lrljoe Date: Wed, 25 Sep 2024 06:30:59 +0100 Subject: [PATCH 2/2] Adjust tests for new Loading blade --- resources/views/components/includes/loading.blade.php | 2 +- tests/Traits/Visuals/LoadingPlaceholderVisualsTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/components/includes/loading.blade.php b/resources/views/components/includes/loading.blade.php index 99875b741..f22096321 100644 --- a/resources/views/components/includes/loading.blade.php +++ b/resources/views/components/includes/loading.blade.php @@ -17,7 +17,7 @@ }} wire:loading.class.remove="hidden d-none" > - +
call('setPerPageAccepted', [1, 5, 10]) - ->assertSeeHtml('tr wire:key="table-loader" class="hidden d-none"') + ->assertSeeHtml('tr wire:key="table-loader') ->call('setPerPage', 5); } @@ -21,7 +21,7 @@ public function test_can_see_placeholder_custom_text(): void Livewire::test(PetsTableLoadingPlaceholder::class) ->call('setPerPageAccepted', [1, 5, 10]) ->assertSeeHtmlInOrder([ - '