filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.3k stars 2.96k forks source link

InfoList Tab persistTabInQueryString() cause unexpected behavior after reloading #7803

Closed ejoi8 closed 11 months ago

ejoi8 commented 1 year ago

Package

filament/filament

Package Version

v3.0.23

Laravel Version

v10.19.0

Livewire Version

v3.0.0-beta.9

PHP Version

PHP 8.1.3

Problem description

I am using persistTabInQueryString() in InfoList Tab and each tab have a action button to edit and update the record. Everthing is good until :

  1. I selected the "Employment Information" tab and reload it (The "Employment Information" tab is selected after reload and it is correct). Then click the "Edit Employment Information" button
  2. A popup appears and all of sudden the query string is switched to "Profile". Then the "Profile" details is blank.
  3. There is no error show at screen and console

Expected behavior

Currently the information in the The "Employment Information" tab is missing after the modal is closed. The expected behavior is the tab should show back the information

Steps to reproduce

Here is the video

https://github.com/filamentphp/filament/assets/7079753/6b14d8ef-077a-4d03-912e-f2a900379705

  1. Login /admin
  2. Click Users menu
  3. Click View button at Admin record
  4. Click Employment Information tab
  5. Refresh the page
  6. Click Edit Employment Information button
  7. Modal will popup then click Cancel
  8. Edit Employment Information tab cannot be click until the first tab is clicked. Then the Employment Information details is missing
  9. Here is the code (line 80 to 154) https://github.com/ejoi8/filamentejoi/blob/73a0942cc3eec7c6165c7df439b2e06af4490183/app/Filament/Resources/UserResource.php#L80

Reproduction repository

https://github.com/ejoi8/filamentejoi

Relevant log output

No error occurs
Zizzanic commented 1 year ago

filamentphp: v3.0.47 livewire: v3.0.3 laravel: v10.23.0 php: 8.1.9

I can confirm this bug, the video posted by @ejoi8 esplains the behaviour very well; the issue is replicated while refreshing one of the secondary tabs and opening and then closing a modal from any tab. By opening and then closing a modal from the first tab, you will experience the issue by clicking on a secondary tab.

So it seems to be related to the refresh while on a secondary tab.

jouniikaheimo commented 1 year ago

I can confirm this bug too without ->persistTabInQueryString() works fine

When tested more closely, the problem occurs in any operation. EditAction, CreateAction, DeleteAction and Notifications..

So there is no dependent modal

danharrin commented 11 months ago

Should be fixed by #10077.