Conditional filter rendering by $activeTab

Hello! I'm using the active tab to decide visibility like here and here. The difference, that I'm using it for a filter, not action, and only a single filter, not all the filters.
Tables\Filters\SelectFilter::make('status')
->visible(fn ($livewire): bool => ! $livewire->activeTab)
Tables\Filters\SelectFilter::make('status')
->visible(fn ($livewire): bool => ! $livewire->activeTab)
My problem is, that it seems like the $livewire->activeTab changes after the page is reloaded. I use "" for the All page, and if I load the page, the status selector is visible, like it should be. If I change to one of the tabs, the page reloads, but the selector is still visible. After the second change it disappears. If I go back to the All, it's not visible, if I change again, it's visible, etc.... Do you guys have any idea what could be the problem, and how can I solve it?
3 Replies
Benjámin
BenjáminOP8mo ago
up, please?
epertinez
epertinez6mo ago
I am stocked in the same problem. I see livewire is sending an update in the request, BUT i don't know how to access livewire data neither so I cannot read the update to make sure all data is in sync before branching.
LeandroFerreira
LeandroFerreira6mo ago
Add in your ListPage
public function updatedActiveTab(): void
{
parent::updatedActiveTab();
$this->resetTable();
}
public function updatedActiveTab(): void
{
parent::updatedActiveTab();
$this->resetTable();
}
@Benjámin 👆
Want results from more Discord servers?
Add your server