rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.7k stars 320 forks source link

[Bug]: setSearchDebounce(1000) has no effect #1605

Closed saleemepoch closed 3 months ago

saleemepoch commented 6 months ago

What happened?

I have the table configured as follows: public function configure(): void { $this->setPrimaryKey('id'); $this->setPerPage(25); $this->setSearchDisabled(); $this->setSearchDebounce(1000); $this->setDebugEnabled(); } I have the columns configured as follows: Column::make("Firstnames") ->secondaryHeader($this->getFilterByKey('firstnames')) ->sortable() ->searchable(), However, the search is not triggered until my mouse goes out of focus.

How to reproduce the bug

The search is not triggered upon very keystroke, only when I click outside the search box.

Package Version

3.1.5

PHP Version

8.2.x

Laravel Version

10.38

Alpine Version

No response

Theme

Tailwind 3.x

Notes

No response

Error Message

No response

lrljoe commented 6 months ago

Are you referring to the secondary header, or the independent search box?

saleemepoch commented 6 months ago

The secondary header

lrljoe commented 6 months ago

Thanks for the information, can you share the code relating to the Column in question please

saleemepoch commented 5 months ago

The issue affects all columns, and what I have is pretty standard:

public function columns(): array
    {
        return [
            Column::make("ID", "id")
                ->sortable()
                ->deselected(),
            Column::make("Firstnames")
                ->secondaryHeader($this->getFilterByKey('firstnames'))
                ->sortable()
                ->searchable(),
            Column::make("Lastname")
                ->secondaryHeader($this->getFilterByKey('lastname'))
                ->sortable()
                ->searchable(),
            Column::make("Email")
                ->secondaryHeader($this->getFilterByKey('email'))
                ->sortable(),
....

This is my configuration:


    public function configure(): void
    {
        $this->setPrimaryKey('id');
        $this->setPerPage(25);
        $this->setSearchDisabled();
        $this->setSearchDebounce(1000);
    }
stale[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

lrljoe commented 4 months ago

If you remove setSearchDisabled()

Type something into the search box, and wait 1 second before doing anything else

Does it then update?

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.