From b95e63eb9b885c8152bd95e61b444ccda3a87ee5 Mon Sep 17 00:00:00 2001 From: Anas Khalifa Date: Sun, 8 Jun 2025 17:40:25 +0300 Subject: [PATCH 1/4] Refactor header cell component to use a span instead of a button for sortable elements --- .../tables/resources/views/components/header-cell.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tables/resources/views/components/header-cell.blade.php b/packages/tables/resources/views/components/header-cell.blade.php index a86788b1ba..1901dbe2d2 100644 --- a/packages/tables/resources/views/components/header-cell.blade.php +++ b/packages/tables/resources/views/components/header-cell.blade.php @@ -23,14 +23,14 @@ @endif {{ $attributes->class(['fi-ta-header-cell px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6']) }} > - <{{ $sortable ? 'button' : 'span' }} + $sortable, 'whitespace-nowrap' => ! $wrap, 'whitespace-normal' => $wrap, match ($alignment) { @@ -67,5 +67,5 @@ ]) /> @endif - + From cae92dc2966ca21f3de83d4eaaf0f7d9f678a8ee Mon Sep 17 00:00:00 2001 From: Anas Khalifa Date: Tue, 10 Jun 2025 10:16:58 +0300 Subject: [PATCH 2/4] add button attributes to the span to better act as a button while keeping the abillity to add components inside --- .../tables/resources/views/components/header-cell.blade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/tables/resources/views/components/header-cell.blade.php b/packages/tables/resources/views/components/header-cell.blade.php index 1901dbe2d2..a5ee654fc4 100644 --- a/packages/tables/resources/views/components/header-cell.blade.php +++ b/packages/tables/resources/views/components/header-cell.blade.php @@ -26,7 +26,11 @@ Date: Tue, 10 Jun 2025 14:21:51 +0100 Subject: [PATCH 3/4] Update header-cell.blade.php --- .../tables/resources/views/components/header-cell.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tables/resources/views/components/header-cell.blade.php b/packages/tables/resources/views/components/header-cell.blade.php index a5ee654fc4..81b39fb2eb 100644 --- a/packages/tables/resources/views/components/header-cell.blade.php +++ b/packages/tables/resources/views/components/header-cell.blade.php @@ -29,8 +29,8 @@ role="button" tabindex="0" wire:click="sortTable('{{ $name }}')" - @keydown.enter="$wire.sortTable('{{ $name }}')" - @keydown.space.prevent="$wire.sortTable('{{ $name }}')" + x-on:keydown.enter="$wire.sortTable('{{ $name }}')" + x-on:keydown.space.prevent="$wire.sortTable('{{ $name }}')" @endif @class([ 'group flex w-full items-center gap-x-1', From cd757b74cb2573a77b956003037c21f7926851f0 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Tue, 10 Jun 2025 14:40:27 +0100 Subject: [PATCH 4/4] Update header-cell.blade.php --- .../tables/resources/views/components/header-cell.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tables/resources/views/components/header-cell.blade.php b/packages/tables/resources/views/components/header-cell.blade.php index 81b39fb2eb..02253ba746 100644 --- a/packages/tables/resources/views/components/header-cell.blade.php +++ b/packages/tables/resources/views/components/header-cell.blade.php @@ -29,8 +29,8 @@ role="button" tabindex="0" wire:click="sortTable('{{ $name }}')" - x-on:keydown.enter="$wire.sortTable('{{ $name }}')" - x-on:keydown.space.prevent="$wire.sortTable('{{ $name }}')" + x-on:keydown.enter.prevent.stop="$wire.sortTable('{{ $name }}')" + x-on:keydown.space.prevent.stop="$wire.sortTable('{{ $name }}')" @endif @class([ 'group flex w-full items-center gap-x-1',