Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll on pagination change in list records #14681

Open
wants to merge 4 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/panels/src/Resources/Pages/ListRecords.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this to the Filament\Tables\Concerns\CanPaginateRecords trait, so it applies to all tables (using InteractsWithTables) and not just the list page?

Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,9 @@ public function getSubNavigation(): array

return [];
}

public function updatedPaginators(): void
{
$this->dispatch('filament-table-pagination-changed', id: $this->getId());
}
}
1 change: 1 addition & 0 deletions packages/tables/resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
@endif
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('table', 'filament/tables') }}"
x-data="table"
x-on:filament-table-pagination-changed.window="if ($event.detail.id === '{{ $this->getId() }}') $el.scrollIntoView()"
@class([
'fi-ta',
'animate-pulse' => $records === null,
Expand Down