Skip to content

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

@slossetti

Description

@slossetti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    In ProgressI've started diagnosing a fixbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions