Get the active tab when submitting a form

Hi everyone, just wondering if there's a way to obtain the active tab when submitting a form. I've tried to persist the active tab in the URL, but can't use the url() helper function inside Livewire. I found a package that's meant to get the current URL inside Livewire, but it does not work.
4 Replies
DrByte
DrByte10mo ago
DrByte
DrByte10mo ago
If yes, then you may find what you're looking for by inspecting the source files related to the Tabs component. Perhaps things like persistTabInQueryString, isTabPersistedInQueryString(), getTabQueryStringKey(). Looks like these are (most of) the source files related to the tab component: https://github.com/filamentphp/filament/blob/3.x/packages/forms/src/Components/Tabs.php https://github.com/filamentphp/filament/blob/3.x/packages/forms/resources/views/components/tabs.blade.php https://github.com/filamentphp/filament/blob/3.x/packages/forms/resources/views/components/tabs/tab.blade.php
GitHub
filament/packages/forms/src/Components/Tabs.php at 3.x · filamentph...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
GitHub
filament/packages/forms/resources/views/components/tabs.blade.php a...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
GitHub
filament/packages/forms/resources/views/components/tabs/tab.blade.p...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
valentin_morice
valentin_morice10mo ago
Thanks for the reply, I finally ended up showing different forms conditionally instead
SirFat
SirFat10mo ago
Cool. If you can mark the issue as solved then that would be neato