Skip to content

[v4] Select column cannot be changed from empty state #17270

@TrioZach

Description

@TrioZach

Package

filament/filament

Package Version

v4.0.0-beta25

Laravel Version

v12.22.1

Livewire Version

v3.6.4

PHP Version

PHP 8.4.11

Problem description

When using a SelectColumn in a table with ->options([...]), if the record doesn't have a state for the column, you can't use the select to change the value of the column. I.e. it won't let you change away from a null value. A validation error occurs, even though the selected option is valid.

Image

Expected behavior

The SelectColumn should validate that the selected option is in fact valid, and save the state.

Steps to reproduce

Simply use a SelectColumn with an options array like so, and try to select any option.

SelectColumn::make('department')
    ->options([
        'sales' => 'Sales',
        'marketing' => 'Marketing',
        'finance' => 'Finance',
        'hr' => 'HR',
        'it' => 'IT',
    ]),

See app/Filament/Resources/People/Tables/PeopleTable.php in the reproduction repository.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/TrioZach/filament-select-column-bug

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions