-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Livewire components not found when using hasCombinedRelationManagerTabsWithContent() #9562
Comments
Hi @joshembling, did yours got fixed? I'm having similar issue. |
No this is still an issue. |
I'm also having same issue. Any workarounds? |
If I disable hasCombinedRelationManagerTabsWithContent(), i as having |
Good day, Had the same issue with a custom dashboard, tabs, and filter. All works well. I am able to show the content I want for each tab using livewire components. But once I click on the filter, the livewire content ghosts me and gives me the error: "Uncaught Snapshot missing on Livewire component with id:" The code is as follows <?php
namespace App\Filament\Pages;
use App\Livewire\AnotherMeterReadings;
use App\Livewire\WaterMeterReadings;
use Filament\Forms\Components\DatePicker;
use Filament\Pages\Dashboard\Actions\FilterAction;
use Filament\Pages\Dashboard as PagesDashboard;
use Filament\Pages\Dashboard\Concerns\HasFiltersAction;
use Filament\Resources\Concerns\HasTabs;
class Dashboard extends PagesDashboard
{
use HasFiltersAction;
use HasTabs;
public ?string $activeTab = null;
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.dashboard';
protected static ?string $slug = '/';
protected function getTabs(): array
{
return [
'tab1' => 'Overview',
'tab2' => 'Graphs',
];
}
protected function getHeaderActions(): array
{
$actions = [
FilterAction::make()
->form([
DatePicker::make('startDate'),
DatePicker::make('endDate')
->default(now()),
// ...
]),
];
return $actions;
}
protected function getTabView($activeTab): ?string
{
switch ($activeTab) {
case 'tab1':
return WaterMeterReadings::class;
case 'tab2':
return AnotherMeterReadings::class;
default:
return WaterMeterReadings::class;
}
}
} <x-filament-panels::page x-data="{activeTab: 'tab1'}" x-init="(console.log(activeTab))">
@dump($this->filters)
<x-filament::tabs label="Overview">
@foreach ($this->getTabs() as $tab => $label)
<x-filament::tabs.item
alpine-active="activeTab === '{{ $tab }}'"
x-on:click="activeTab = '{{ $tab }}'"
>
{{ $label }}
</x-filament::tabs.item>
@endforeach
</x-filament::tabs>
@foreach ($this->getTabs() as $tab => $component)
<div wire:key="{{ $tab }}" x-show="activeTab === '{{ $tab }}'">
@dump($this->filters)
<div>
{{-- This is the content for tab {{ $tab }} --}}
@livewire($this->getTabView($tab), ["filters" => $this->filters], ["key" => $tab])
</div>
</div>
@endforeach
</x-filament-panels::page> The livewire component is a simple widget as follows: <?php
namespace App\Livewire;
use App\Models\WaterMeter;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Filament\Widgets\Concerns\InteractsWithPageFilters;
use Filament\Widgets\TableWidget as BaseWidget;
class WaterMeterReadings extends BaseWidget
{
use InteractsWithPageFilters;
public function table(Table $table): Table
{
return $table
->query(
WaterMeter::query()
)
->columns([
TextColumn::make('name'),
]);
}
} A couple of snaps: Initial load: When I open Filter: Hope someone can help. |
Package
filament/filament
Package Version
^3.0-stable
Laravel Version
^10.0
Livewire Version
No response
PHP Version
PHP 8.1.0
Problem description
When rendering a custom livewire component on a resource, that is nested within tabs (as per
hasCombinedRelationManagerTabsWithContent()
, any time you switch between tabs page stops working with a console error:Uncaught (in promise) Component not found: {id}
Expected behavior
Switch between tabs and keep renders of custom Livewire components
Steps to reproduce
php artisan db:seed
Reproduction repository
https://github.com/joshembling/filament-tabs-livewire
Relevant log output
Donate 💰 to fund this issue
The text was updated successfully, but these errors were encountered: