Skip to content

One character delay on column search #1292

Answered by lrljoe
mobunti asked this question in Q&A
Discussion options

You must be logged in to vote

You are indeed correct.

It's an oddity with how everything loads in!

Rather than using the builder() function to set a search, either just set searchable() on the appropriate column, or you can use a callback on any column if you want:

Column::make('Name')
    ->searchable(
        fn(Builder $query, $searchTerm) => $query->orWhere("marks.vrn","like","%".$searchTerm."%")
    ),

That should keep in sync, much more smoothly. It applies to the filters as well, so make sure to use the filter() callback on the filter itself rather than using a when() statement in the builder!

Tables V3 is almost ready, and uses Livewire 3 by the way, but I'll likely backport some code to V2 and do some fixes…

Replies: 1 comment 5 replies

Comment options

lrljoe
Aug 5, 2023
Collaborator Sponsor

You must be logged in to vote
5 replies
@mobunti
Comment options

@lrljoe
Comment options

lrljoe Aug 6, 2023
Collaborator Sponsor

Answer selected by mobunti
@lrljoe
Comment options

lrljoe Aug 6, 2023
Collaborator Sponsor

@mobunti
Comment options

@lrljoe
Comment options

lrljoe Aug 9, 2023
Collaborator Sponsor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants