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

Clear Filters not showing when using queryString #1563

Closed
carloeusebi opened this issue May 22, 2024 · 1 comment
Closed

Clear Filters not showing when using queryString #1563

carloeusebi opened this issue May 22, 2024 · 1 comment
Assignees

Comments

@carloeusebi
Copy link

carloeusebi commented May 22, 2024

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.3

PowerGrid

5.6

Laravel

11.7

Livewire

3.4

Alpine JS

No response

Theme

Tailwind 3.x with tailwind/forms

Describe the bug.

When using the query string function, on page load the filters are populatad from the params in the query string, but the $enabledFilters is not.
This means that the clear filter button for the filter is not showing.

As you can see in the image beloew, the 'Inizio Terapia' filter was populated from the query and it is not showing in the enabledFilters array, while the 'Stato' filter was just changed by hand, and it showing in the enabledFilters, and it is correctly showing the clear filter button.

The same result heappens for each filter, so it not specific for the 'Inizio Terapia' filter.

It also happens if I use return [ ...$this->powerGridQueryString()] in the queryString as described in the documentation.

Screenshot from 2024-05-22 09-28-30

Extra information

<?php
 //...
    protected function queryString(): array
    {
        return [
            'page' => ['except' => 1, 'as' => 'pagina'],
            'search' => ['except' => '', 'as' => 'cerca'],
            'filters.boolean.archived_at' => ['except' => '', 'as' => 'stato'],
            'filters.date.therapy_start_date' => ['except' => '', 'as' => 'data'],
        ];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants