Skip to content

Commit

Permalink
Table: add no-hover (#652)
Browse files Browse the repository at this point in the history
Disable hover effect on rows.
  • Loading branch information
robsontenorio authored Sep 28, 2024
1 parent 3ed8a14 commit 05e9ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/View/Components/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct(
public ?bool $showEmptyText = false,
public mixed $emptyText = 'No records found.',
public string $containerClass = 'overflow-x-auto',
public ?bool $noHover = false,

// Slots
public mixed $actions = null,
Expand Down Expand Up @@ -299,7 +300,7 @@ class="@if($isSortable($header)) cursor-pointer hover:bg-base-200 @endif {{ $hea
@foreach($rows as $k => $row)
<tr
wire:key="{{ $uuid }}-{{ $k }}"
class="hover:bg-base-200/50 {{ $rowClasses($row) }}"
@class([$rowClasses($row), "hover:bg-base-200/50" => !$noHover])
@if($attributes->has('@row-click'))
@click="$dispatch('row-click', {{ json_encode($row) }});"
@endif
Expand Down

0 comments on commit 05e9ab0

Please sign in to comment.