Replies: 3 comments
-
I think the reason here is more likely due to the fact that a multi-select filter does not keep the selected items even if persisting is enabled. Therefore if one does decide to write JS to re-select the filters from the persisted state the structure in the Livewire requests gets messed up resulting in the error. |
Beta Was this translation helpful? Give feedback.
-
I am using tom select and its working fine with persist. Can you try with tom select. may be its only the problem with slim select. |
Beta Was this translation helpful? Give feedback.
-
NoteFrom now on we will follow everything in one place. We will use the discussions tab to allow other users to also interact similarly to Livewire, which is why I am turning this issue into a discussion. Thanks for understanding |
Beta Was this translation helpful? Give feedback.
-
Have you searched through other issues to see if your problem is already reported or has been fixed?
Yes, I did not find it.
Did you read the documentation?
Yes, I did not find it.
Have you tried to publish the views?
Yes - I didn't work.
Is there an error in the console?
No
PHP Version
8.2
PowerGrid
5.10.4
Laravel
11
Livewire
No response
Alpine JS
No response
Theme
Tailwind 3.x
Describe the bug.
@luanfreitasdev
Sadly I am not experienced enough with Livewire to fully understand what is going here so I am creating this bug report.
The component I am talking about is this one: https://github.com/Power-Components/livewire-powergrid/blob/6.x/resources/views/components/inputs/select.blade.php#L73
I wanted to add persisting in my table for the filters. So what I did was adding this line
$this->persist['filters'];
to thesetup()
.However what I noticed was that the filters after reloading the page where not selected anymore. The query worked fine with the filters but the MultiSelect had no options selected.
So I did a
$this->dispatch('activeFilters', $this->filters);
and listened to it in my view using javascript.When re-adding the filters to the slimselect using
MYCOMPONENT.slim.setSelected(['option1'], false);
.I noticed that it then corrupted the sql upon reloading the page. Saying that
value_in_my_query.values
does not exist as a column.I don't really know how to format this bug report because I think it is so absurd
To Reproduce...
First click on "FOO" then....
Extra information
Beta Was this translation helpful? Give feedback.
All reactions