Persistent Livewire Modal State Issue with Multiple Header Actions

Environment: * Filament Version: 3 * Laravel Version: 12 * PHP Version: 8.3 Problem Description: I have a Filament table with two headerActions: a default ExportAction and a custom Action that opens a modal with a file upload form. When I click the first action (e.g., Export), its modal opens correctly. However, after closing it, if I click the second action (the custom one), the first action’s (Export) modal opens again instead of its own. The same happens in reverse. What Has Been Tried (Diagnostics): 1. Unique Names: We ensured both actions had unique names using ->make('unique-name'). The rendered HTML confirmed the wire:click handlers were correct (mountTableAction('export') and mountTableAction('searchSimilar')), but the issue persisted. 2. Inline Action: To completely eliminate any conflict with the custom class, we rewrote the action directly inside the headerActions array within the Resource file. The issue still occurs even with this setup.
// In PartResource.php

// Required imports:
use App\Jobs\ProcessPartSimilarSearchJob;
use App\Models\Source;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Notifications\Notification;
use Filament\Tables\Actions\Action;
use Filament\Tables\Actions\ExportAction;
use Illuminate\Support\Facades\Auth;

// ...

->headerActions([
ExportAction::make('export')
>exporter(PartExporter::class),

PartSimilarSearchTableAction::make('searchSimilar'),
])
// In PartResource.php

// Required imports:
use App\Jobs\ProcessPartSimilarSearchJob;
use App\Models\Source;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Notifications\Notification;
use Filament\Tables\Actions\Action;
use Filament\Tables\Actions\ExportAction;
use Illuminate\Support\Facades\Auth;

// ...

->headerActions([
ExportAction::make('export')
>exporter(PartExporter::class),

PartSimilarSearchTableAction::make('searchSimilar'),
])
29 Replies
MK | Programmer
MK | ProgrammerOP3mo ago
The last time I clicked on "Exportar Peças" after refreshing the page, the correct modal was loaded. However, the issue reversed — now the "Buscar Similares" button is showing the same modal.
stanwarri
stanwarri3mo ago
@MK | Programmer Were you able to solve this issue?
MK | Programmer
MK | ProgrammerOP3mo ago
@stanwarri Not yet, I'm still waiting for a response. I converted the actions into pages to solve the issue, as I couldn't get them to work properly as modals.
stanwarri
stanwarri3mo ago
@MK | Programmer I'm currently experiencing this and haven't been able to figure out what is happening
Dennis Koch
Dennis Koch3mo ago
Does this happen with any 2 actions that open a modal? Or just those specific ones?
MK | Programmer
MK | ProgrammerOP3mo ago
@Dennis Koch In any resource where I add two or more actions, it does that.
Dennis Koch
Dennis Koch3mo ago
That sounds weird. Are you on the latest version? You just said your are on Filament v3. If yes: Can you reproduce that with a fresh install of Filament?
MK | Programmer
MK | ProgrammerOP3mo ago
In a fresh install of Filament, I don't have this issue. But my project is already quite large and has been in development for months. This started happening only recently, and I haven't done anything different that I can recall.
Dennis Koch
Dennis Koch3mo ago
Did you overwrite any view files?
stanwarri
stanwarri3mo ago
@Dennis Koch Yes, it happens when I have 2 or more modal actions, like in a relationship manager with default edit and delete actions. I upgraded to 3.3.31. 2 days ago, and started experiencing this. Even when I downgraded to previous versions, they issue still remains.
MK | Programmer
MK | ProgrammerOP3mo ago
In my composer.json: "filament/filament": "^3.2",
Dennis Koch
Dennis Koch3mo ago
Did any of you overwrite view files?
MK | Programmer
MK | ProgrammerOP3mo ago
No
Dennis Koch
Dennis Koch3mo ago
Can you try running artisan filament:upgrade if you didn't already?
MK | Programmer
MK | ProgrammerOP3mo ago
I did that.
stanwarri
stanwarri3mo ago
Wow, this just solved the problem. I need knew that the filament vendor files were pubished. Deleting those just solved the problem
Dennis Koch
Dennis Koch3mo ago
Please never overwrite view files unless you know what you are doing and you absolutely have to. This will very likely cause issues with every upgrade. What does artisan about --only=filament output?
stanwarri
stanwarri3mo ago
I know right. This can happen when working in a team. I will enforce policy on that Thank @Dennis Koch for the pointer.
MK | Programmer
MK | ProgrammerOP3mo ago
@Dennis Koch Thaank you!! My views were indeed published — someone from the project did it, and I'm investigating why. But after deleting them, it was fixed.
Dennis Koch
Dennis Koch3mo ago
Great that we checked that 😅 Are you guys working on the same team? 😅
MK | Programmer
MK | ProgrammerOP3mo ago
No
Dennis Koch
Dennis Koch3mo ago
Would have been funny 😅
MK | Programmer
MK | ProgrammerOP3mo ago
Yes, really lol 😄
stanwarri
stanwarri3mo ago
Hahaha, I think this might be a general issue for people working in teams if not carefully checked. Another lesson for me is that when working on a big project and some of these issues arises, we tend to solve it by trying to dig deeper when the solution might actually be simple. You sometimes need a third eye, or step away from the problem to realize what the solution would have been. I'm truly humbled by this experience considering the fact that I have known about the implication of publishing view assets, and have guided against it in the past.
islandnuge
islandnuge3mo ago
@stanwarri glad you were able to get this resolved - would you mind clarifying what you did exactly to remove the views? I cleared my vendor and re-installed, and deleted public/js/filament and public/css/filament but think I probably missed something described above. I also ran php artisan optimize:clear too - but i'm still seeing the same behavior.
stanwarri
stanwarri3mo ago
@islandnuge You need to delete filament folder in the resources/views/vendor folder. That's what need to be deleted
islandnuge
islandnuge3mo ago
@stanwarri thank you so much - that issue has been on my list to resolve for over a month! You saved my bacon!
Dennis Koch
Dennis Koch3mo ago
Why do so many people publish the view files 🙈 Btw: You could have saved yourself a lot of time if you'd read the "Read before posting" guide 😅 It's mentioned in "First Aid" https://discord.com/channels/883083792112300104/1167015843020943390
islandnuge
islandnuge3mo ago
i'm not sure when that happened in our project - appreciate the advice

Did you find this page helpful?