Skip to content

Commit

Permalink
Merge pull request #12860 from dev-idkwhoami/fix/visual-bug-when-usin…
Browse files Browse the repository at this point in the history
…g-select-current-page-only-with-grouping

Fix: Visual bug when using selectCurrentPageOnly in combination with grouping
  • Loading branch information
danharrin committed May 20, 2024
2 parents 25e0563 + 380dd2a commit 1108fd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@props([
'key',
'page' => null,
'title',
])

{{-- format-ignore-start --}}
<x-filament-tables::selection.checkbox
:wire:key="$this->getId() . 'table.bulk_select_group.checkbox.' . $page"
:label="__('filament-tables::table.fields.bulk_select_group.label', ['title' => $title])"
:x-bind:checked="'
const recordsInGroup = getRecordsInGroupOnPage(' . \Illuminate\Support\Js::from($key) . ')
Expand Down
6 changes: 5 additions & 1 deletion packages/tables/resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$columnsCount = count($columns);
$reorderRecordsTriggerAction = $getReorderRecordsTriggerAction($isReordering);
$toggleColumnsTriggerAction = $getToggleColumnsTriggerAction();
$page = $this->getTablePage();
if (count($actions) && (! $isReordering)) {
$columnsCount++;
Expand Down Expand Up @@ -260,7 +261,7 @@ class="fi-ta-header-toolbar flex items-center justify-between gap-x-4 px-4 py-3
<x-filament-tables::selection.indicator
:all-selectable-records-count="$allSelectableRecordsCount"
:colspan="$columnsCount"
:page="$this->getTablePage()"
:page="$page"
:select-current-page-only="$selectsCurrentPageOnly"
x-bind:hidden="! selectedRecords.length"
x-show="selectedRecords.length"
Expand Down Expand Up @@ -459,6 +460,7 @@ class="col-span-full"
<x-slot name="start">
<div class="px-3">
<x-filament-tables::selection.group-checkbox
:page="$page"
:key="$recordGroupKey"
:title="$recordGroupTitle"
/>
Expand Down Expand Up @@ -999,6 +1001,7 @@ class="bg-gray-50 dark:bg-white/5"

<x-filament-tables::selection.group-cell>
<x-filament-tables::selection.group-checkbox
:page="$page"
:key="$recordGroupKey"
:title="$recordGroupTitle"
/>
Expand All @@ -1020,6 +1023,7 @@ class="p-0"
@if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::AfterCells)
<x-filament-tables::selection.group-cell>
<x-filament-tables::selection.group-checkbox
:page="$page"
:key="$recordGroupKey"
:title="$recordGroupTitle"
/>
Expand Down

0 comments on commit 1108fd6

Please sign in to comment.