Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal hidden / heading / description closures evaluated multiple times #11424

Closed
binaryfire opened this issue Feb 15, 2024 · 4 comments · Fixed by #11746
Closed

Modal hidden / heading / description closures evaluated multiple times #11424

binaryfire opened this issue Feb 15, 2024 · 4 comments · Fixed by #11746
Labels
bug Something isn't working low priority unconfirmed
Milestone

Comments

@binaryfire
Copy link
Contributor

binaryfire commented Feb 15, 2024

Package

filament/filament

Package Version

v3.2.34

Laravel Version

v10.3.3

Livewire Version

v3.4.4

PHP Version

8.3

Problem description

The modalHidden(), modalHeading() and modalDescription() closures on actions are evaluated multiple times.

This causes all queries / notifications etc. used in these closures to be executed multiple times.

Expected behavior

These methods should only be evaluated once.

Steps to reproduce

Download reproduction repo, go to "Products" and click the "Modal test" header action. You'll see the notification being sent in each closure firing multiple times.

Reproduction repository

https://github.com/binaryfire/filament-reproduction-repo

Relevant log output

No response

@binaryfire binaryfire added bug Something isn't working low priority unconfirmed labels Feb 15, 2024
@zepfietje zepfietje added this to the v3 milestone Feb 16, 2024
@danharrin
Copy link
Member

Removing the form() doesnt fix the problem on my end

@binaryfire
Copy link
Contributor Author

@danharrin Confirmed. Must have been sleep deprived when I wrote that. I've updated the issue.

@danharrin
Copy link
Member

Some of the calls can now be avoided if you inform Filament that the action explicitly has a modal (#11746).

The rest of the calls are due to a bug in Laravel's anonymous Blade component tag implementation. I am working on a Laravel PR, but fixing this in the Filament core would make the code messier, so I want to avoid that.

@danharrin
Copy link
Member

laravel/framework#50403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority unconfirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants