Merge pull request #16429 from anasgets111/3.x

Replace button with span for sortable column headers
This commit is contained in:
Dan Harrin
2025-06-10 14:41:17 +01:00
committed by GitHub
@@ -23,14 +23,18 @@
@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' }}
<span
@if ($sortable)
aria-label="{{ trim(strip_tags($slot)) }}"
type="button"
role="button"
tabindex="0"
wire:click="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',
'cursor-pointer' => $sortable,
'whitespace-nowrap' => ! $wrap,
'whitespace-normal' => $wrap,
match ($alignment) {
@@ -67,5 +71,5 @@
])
/>
@endif
</{{ $sortable ? 'button' : 'span' }}>
</span>
</th>