-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Redirecting to a download in an Action within a modal causes the modal to reopen on next close #15141
Comments
You should be able to use URL with a closure? ->extraModalFooterActions([
Action::make('download')
->url(fn($record) => 'https://central.github.com/deployments/desktop/desktop/latest/win32')
->openUrlInNewTab(),
]) |
The problem is the url method runs on page load so the link tracking I'm trying to implement is triggered on page load as well, which makes the data unusable. Additionally, using the url method seems to ignore the action method. That makes sense since it's probably an action underneath but means I have no hook for the code I need to run. |
But the url isn't accessed on page load.... |
Tested locally in my project, and the url method is being triggered when the modal is opened. So not page load, but still before I need it to trigger. |
the url should be loaded but not opened, tracking should only work on a page load. Unless you are tracking for where the url is loaded in the DOM |
I need to track when the url is accessed. This is a Download button, and we want to know how many people have downloaded the content item. By putting the tracking code in the url method, it gets run when the modal is opened which does not mean they have actually accessed the button yet. When using the url method, the action method is ignored, which is where I would put the tracking code if it was still run. Where can I place my tracking code so that it is run when the button is actually pressed?
|
Package
filament/filament
Package Version
v3.2.131
Laravel Version
v11.36.1
Livewire Version
v3.5.12
PHP Version
PHP 8.3.14
Problem description
After clicking on an Action that is set to redirect to a download attachment URL (that will open the download dialog) inside a modal, then closing the modal, the modal reopens one time.
Expected behavior
That the modal does not reopen at all.
Steps to reproduce
In the reproduction repository:
composer install
,php artisan key:generate
,php artisan migrate --seed
/admin
[email protected]
passwordtest
The related code is in
app/Filament/Pages/Test.php
:Reproduction repository (issue will be closed if this is not valid)
https://github.com/ahamilton9/filament-issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: