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
Are you referring to the kind of tab mentioned on this page of the docs? https://filamentphp.com/docs/3.x/forms/layout/tabs#setting-the-default-active-tab
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.phpGitHub
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
Thanks for the reply, I finally ended up showing different forms conditionally instead
Cool. If you can mark the issue as solved then that would be neato