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

Actions that ->requiresConfirmation() 's notifications are run twice #11099

Closed
dissto opened this issue Jan 26, 2024 · 4 comments
Closed

Actions that ->requiresConfirmation() 's notifications are run twice #11099

dissto opened this issue Jan 26, 2024 · 4 comments
Assignees
Labels
Milestone

Comments

@dissto
Copy link
Contributor

dissto commented Jan 26, 2024

Package

filament/filament

Package Version

v3.2

Laravel Version

v10.00

Livewire Version

v3

PHP Version

PHP 8.3.0

Problem description

An action (Filament\Actions\Action) with ->requiresConfirmation() has trigger a notification via the ->action() method causes the notification to run twice?!

I have attached a video that showcases it.

2024-01-26.22-36-41.mp4

Expected behavior

To not run twice

Steps to reproduce

Just use the UserResource (edit a user) as an example. This repo is ready to run migrate:fresh --seed which seeds the user [email protected] with the default password.

Reproduction repository

https://github.com/dissto/filament-actions-notifications-fire-twice

Relevant log output

No response

@danharrin
Copy link
Member

So I definitely don't think this is a case of them firing twice - they fire once, but you can still see the notification from the previous request as it hasnt transitioned out yet. I think there is a slight animation issue with transitioning new stacked notifications into view that creates a double request effect, so that could be investigated. But it's definitely low priority and doesn't really affect usability.

Screen.Recording.2024-01-27.at.12.02.20.mov

@beysach
Copy link
Contributor

beysach commented Jan 31, 2024

I verified the existence of this issue through the use of the requiresConfirmation() function.

@beysach
Copy link
Contributor

beysach commented Jan 31, 2024

To solve this problem I comment line 26 to 38 then notification started working normal without glitch effect.

vendor\filament\actions\resources\views\components\modals.blade.php
line 26

            {{-- x-on:modal-closed.stop="
                const mountedActionShouldOpenModal = {{ \Illuminate\Support\Js::from($action && $this->mountedActionShouldOpenModal()) }}

                if (! mountedActionShouldOpenModal) {
                    return
                }

                if ($wire.mountedFormComponentActions.length) {
                    return
                }
               // $wire.unmountAction(false) is causing a problem.
                $wire.unmountAction(false)
            " --}}

@zepfietje
Copy link
Member

This issue is caused by notification animations being triggered by the Livewire request.

It happens in:

The vertical notification animation has been broken since Livewire v3, and I haven't been able to fix it yet. Will close this issue as it's part of #7395.

@zepfietje zepfietje closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants