filament icon indicating copy to clipboard operation
filament copied to clipboard

Cannot read properties of undefined (reading 'dispatchEvent') Action in table

Open Simone4e opened this issue 7 months ago • 1 comments

Package

filament/filament

Package Version

v3x

Laravel Version

v12

Livewire Version

No response

PHP Version

php 8.4

Problem description

When I click on the icon column instead of opening the modal the first time it gives me an error, the second time it works.

Expected behavior

It should open the first time

Steps to reproduce

  • Go to users
  • Click icon column test
  • Try to click the second icon column test and see console log output, then try again it will open the modal

Reproduction repository (issue will be closed if this is not valid)

https://github.com/Simone4e/Bug-filament-Dispatch

Relevant log output

VM2877:21 Uncaught TypeError: Cannot read properties of undefined (reading 'dispatchEvent')
    at eval (eval at safeAsyncFunction (livewire.js?id=df3a17f2:1174:21), <anonymous>:21:43)
    at livewire.js?id=df3a17f2:1527:9
    at releaseNextTicks (livewire.js?id=df3a17f2:1535:24)
    at livewire.js?id=df3a17f2:1522:9

Simone4e avatar May 20 '25 06:05 Simone4e

I noticed that if I do a search in the modal that gives the error or change the columns the problem doesn't exist, the last modal opens the first time.

If i use ->deferLoading() in the last table all work.

Simone4e avatar May 20 '25 11:05 Simone4e

Hi, opening a modal in a table that exists in another modal is not something that we have ever supported in Filament, and anyone who has gotten it to work previously has either had really good luck or managed to hack their way around the flaws. As such, I won't be fixing this issue as it isn't a supported behaviour.

However, in v4 I am looking at adding support for nested modals from tables, but the work has not started yet. It should be complete by the stable release, so once that is released please test it out and open an issue if this still doesn't work for you.

danharrin avatar Jul 11 '25 11:07 danharrin