reset tab
This commit is contained in:
1 parent
9b8bbefa5e
commit
e665bb183d
2 files changed
+15
-4
No files matched your search
@@ -5,11 +5,20 @@
|
||||
@endphp
|
||||
<x-filament-panels::page>
|
||||
|
||||
<script>
|
||||
window.addEventListener('reset-tab', () => {
|
||||
if (Alpine.$data(document.querySelector('#charttabs')).activeTab == 'tab3' ||
|
||||
Alpine.$data(document.querySelector('#charttabs')).activeTab == 'tab4') {
|
||||
Alpine.$data(document.querySelector('#charttabs')).activeTab = 'tab1';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ $this->filtersForm }}
|
||||
|
||||
@livewire(\App\Filament\Widgets\StatsMedianAverage::class, ['filters' => $this->filters])
|
||||
|
||||
<div x-data="{ activeTab: 'tab1' }">
|
||||
<div x-data="{ activeTab: 'tab1' }" id="charttabs">
|
||||
<!-- Tab Navigation -->
|
||||
<x-filament::tabs label="Statistics" class="mb-4 justify-center rounded-lg grid grid-cols-2 md:grid-cols-4">
|
||||
<x-filament::tabs.item x-on:click="activeTab = 'tab1'" :alpine-active="'activeTab === \'' . 'tab1' . '\''" icon="phosphor-trophy">
|
||||
|
||||
Reference in new issue
Block a user