You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that nobody is going to look at this problem because I don't have time or knowledge to create a easy repository with an example, but I think it is an important problem so, here you have it, just in case.
I have a resource with products that are related to a category (how not). Categories are hierarchical and can have many levels, but filtering by 3 levels is enough for me.
So I create the filters of the table so the first shows the first level categories, and the next two get filled in depending on the previous filter:
Now, that works at the first time, but once I change the value of the first filter, even when options of the second is recalculated, $livewire->getTableFilterState() and $livewire->getTable()->getFilters() do not return the new selected value but the previous one (the one on the url).
Don't think that is how it should work, but appart of that, I found no way to return the actual current value of the new selected option.
Neither I found a way to force refresh the page on select change, which is not ideal but would solve the problem.
Expected behavior
$livewire->getTableFilterState() and $livewire->getTable()->getFilters() should return the new values or at least there should have to be a way (documented?) to know what is the real value of the selected option, so you can act on those to decide on other filter behaviours.
Steps to reproduce
Create a Resource attached to a table
Create filters as shown.
See that while debugging or /dd($livewire->getTableFilterState('categoria_principal'),$livewire->getTable()->getFilters()['categoria_principal']->getState());/ inside of the options function of the second selectfilter, you get the first value of the filter and not the new one.
Reproduction repository (issue will be closed if this is not valid)
.
Relevant log output
The text was updated successfully, but these errors were encountered:
Hey @epertinez! We're sorry to hear that you've hit this issue. 💛
However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?
We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.
Package
filament/filament
Package Version
v3.3.0
Laravel Version
v10
Livewire Version
v3
PHP Version
8.3
Problem description
I understand that nobody is going to look at this problem because I don't have time or knowledge to create a easy repository with an example, but I think it is an important problem so, here you have it, just in case.
I have a resource with products that are related to a category (how not). Categories are hierarchical and can have many levels, but filtering by 3 levels is enough for me.
So I create the filters of the table so the first shows the first level categories, and the next two get filled in depending on the previous filter:
Now, that works at the first time, but once I change the value of the first filter, even when options of the second is recalculated, $livewire->getTableFilterState() and $livewire->getTable()->getFilters() do not return the new selected value but the previous one (the one on the url).
Don't think that is how it should work, but appart of that, I found no way to return the actual current value of the new selected option.
Neither I found a way to force refresh the page on select change, which is not ideal but would solve the problem.
Expected behavior
$livewire->getTableFilterState() and $livewire->getTable()->getFilters() should return the new values or at least there should have to be a way (documented?) to know what is the real value of the selected option, so you can act on those to decide on other filter behaviours.
Steps to reproduce
Create a Resource attached to a table
Create filters as shown.
See that while debugging or /dd($livewire->getTableFilterState('categoria_principal'),$livewire->getTable()->getFilters()['categoria_principal']->getState());/ inside of the options function of the second selectfilter, you get the first value of the filter and not the new one.
Reproduction repository (issue will be closed if this is not valid)
.
Relevant log output
The text was updated successfully, but these errors were encountered: