F
Filament3mo ago
jw

Programmatically change active Tab

Hi, I'm trying to change the active tab of the tabs form component.
I'm using this code to trigger a traditional html click event when a checkbox is ticked. Is there a better way to do this? I tried things like setting the 'activeTab' but it didn't work. TYIA if ($state) { $this->js("function clickGuardianTab() { var guardianTabButton = Array.from(document.querySelectorAll('button[role="tab"]')).find(btn => btn.textContent.trim().toLowerCase() === 'guardian'); guardianTabButton.click();
}"); }
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?