Second modal always shows the first modal's content
Hi everyone, I'm stuck on a stubborn modal issue. On a custom page with a table, my first modal action works fine. But after I close it, any other modal action I click just shows the content of the first one again, not the new one.
I've tried all the standard solutions for this "stale state" problem, and even the most aggressive fixes are not working:
1. Overriding mountAction() to call $this->reset() at the very beginning. The state is being reset on the server.
2. Using JavaScript to listen for an event and forcefully clear the modal's HTML (.innerHTML = '') before the new content is loaded.
Even with both the server-side state and the frontend DOM being cleared on every click, the old modal content still reappears.Has anyone ever seen behavior like this? I'm looking for ideas on what could possibly cause the frontend to ignore state changes so aggressively.
Thanks for any help!
12 Replies
- Are you on the latest version?
- Did you publish/overwrite some view files?
- Can you reproduce this in a fresh install?
Thanks for the guidance. I've checked, and here are the results:
- Version: I am currently on Filament v3.3.32.
- Published Views: Yes, you are right. I have published and am using an overwritten view file for the specific page where the modal state bug occurs.
- Fresh Install Test: This is the key finding. I tested the exact same functionality on a fresh project using an older version, Filament v3.3.16, and the problem does not exist there.
To pinpoint the issue, is this bug likely caused by my overwritten view file being incompatible with the changes in v3.3.32, or is this a known regression in that specific version?
I haven't heard of an issue of this type yet.
So when you update that "fresh install" does it break again?
It's normal to have a custom view for a custom page. I meant whether you have published view files from the vendor folde.r
My project heavily customizes views, including both views published from the vendor and fully custom views. However, even actions that display modals for table records face the same issue. I’m not sure what’s causing this
For example, I have two actions as shown in the image. When I first access the page and select Modal 1, then close it and select Modal 2, it displays the same content as Modal 1 (no slideover, and the form is identical to Modal 1), and vice versa

Okay, published views can always cause trouble. Can you try deleting them and check whether it works?
Hey, I just discovered that my project using Filament v3.3.16 works perfectly fine, but after upgrading to v3.3.33, I encountered the same issue.
I just checked and it seems this issue has been present since Filament v3.3.19 up to the current version. Versions <= v3.3.18 work fine. I'm wondering if I'm the only one experiencing this problem.
Does it also happen without the published views?
Yes, this issue occurs in all cases for me
Can you isolate the issue in a fresh install and create an issue on GitHub?
Of course, let me reproduce this issue.
While waiting, I found that the Filament v3.3.19 update is related to modals. I tested it on two projects: one project has the issue, while the other does not. My current project was built from the one with the error, and I’m unsure of the root cause. XD
