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
18.21k stars 2.85k forks source link

Table filters seems not working properly #7440

Closed daison12006013 closed 1 year ago

daison12006013 commented 1 year ago

Package

filament/tables

Package Version

v3.0.2

Laravel Version

v10.17.0

Livewire Version

v3.0.0-beta.6

PHP Version

PHP 8.1.21

Problem description

Here's what it looks like in my filters

image

Here's what it looks like in the UI, it seems the filter isn't updating instantly image

Expected behavior

When toggling, it should filter the lists instantly.

Steps to reproduce

Reproduction repository

-

Relevant log output

No errors at all, I can backtrace the line after the query was called, please let me know if you want me to die-dump the backtrace from that closure.
daison12006013 commented 1 year ago

Here's the diff changes, I changed the type from .diff to .txt as I can't attach it here.

stagedAndUnstaged.txt

danharrin commented 1 year ago

Please use the latest Filament stable version and submit a complete reproduction repository, not just code in a screenshot. I will reopen the issue when you do this.

The URL of a public GitHub repository which reproduces 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. This allows us to fix the problem much quicker. This issue will be automatically closed and not reviewed if this is missing. Please make sure to format the URL starting with https://github.com - only repositories hosted on GitHub are accepted.

daison12006013 commented 1 year ago

@danharrin have you noticed this git diff, or you still want a github repo? 🤔

https://github.com/filamentphp/filament/issues/7440#issuecomment-1664903080

DIFF FILE: https://github.com/filamentphp/filament/files/12256618/stagedAndUnstaged.txt

danharrin commented 1 year ago

I want a repo, the diff is not practical

frits-metalogix commented 8 months ago

For those still struggling with this, it looks like the name of the query builder parameter in the closure is important, the docs have it as "query" and it looks like it needs to be "query" ?

4RSIM3R commented 6 months ago

hey, i have same problem here, i create a SelectFilter with relationship like this :

SelectFilter::make('employee')
                    ->relationship('employee', 'name')
                    ->searchable()
                    ->preload(),

its seem the result is also not instantly appear

alvarom-aliad commented 6 months ago

I have the same problem. When changing the value of a filter it does not filter, you have to click again anywhere on the screen to make the filter actually happen.

I tried with different types of filters but happens with all of them.

izzilan commented 5 months ago

Any fix for this? same error here

heruprambadi commented 2 months ago

Any fix for this? same error here. But i don't use relation. I create like : Select::make('status_peminjaman') ->options([ 'dipinjam' => 'Dipinjam', 'dikembalikan' => 'Dikembalikan' ])

it only work when i click outside the filter first.