rappasoft / laravel-livewire-tables

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

[Bug]: When searching and using the placeholder enabled, the table columns breaks #1964

Closed slossetti closed 1 month ago

slossetti commented 1 month ago

What happened?

In my table, when I have the placeholder enabled. $this->setLoadingPlaceholderEnabled();

class UserTable extends DataTableComponent
{
    protected $model = User::class;

    public function configure(): void
    {
        $this->setPrimaryKey('id');
        $this->setLoadingPlaceholderEnabled();
    }

    public function columns(): array
    {
        return [
            Column::make("Id", "id")
                ->sortable(),
            Column::make("Name", "name")
                ->sortable(),
            Column::make("Email", "email")
                ->sortable(),
            Column::make("Created at", "created_at")
                ->sortable(),
            Column::make("Updated at", "updated_at")
                ->sortable(),
        ];
    }
}

and when searching using the search input, the table display breaks when showing results.

Before search image

After search image

After remove the searched word image

How to reproduce the bug

$this->setLoading Placeholder Enabled();

Then tries to search something.

Package Version

3.4.20

PHP Version

8.2.x

Laravel Version

10 and 11

Alpine Version

No response

Theme

Tailwind 3.x

Notes

No response

Error Message

No response

lrljoe commented 1 month ago

Thanks for the bug report, I've identified the issue, and will issue a fix in the next 48 hours.

lrljoe commented 1 month ago

This will be fixed in v3.4.22 (to be released later today)

lrljoe commented 1 month ago

Version was released, please reach out if there is still an issue