© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
rajul

Position of element in Dependent Select Field Option

I have a
status
status
field in a Model, where I want to show specfic set of options in Select Field based on value of
status
status

I find that position of element is not correct after selecting and updating a form. Let me explain it with example:
If current
status
status
is triage and user selects 'in_progress' and save form. then Form shows the correct new options in Select (in_progress, complete, triage) but current selected option it shows is 'complete' whereas its current state is 'in_progress'
Can someone please have a look at following code, If I am doing something wrong.
return $form
            ->schema([
                Select::make('status')
                ->options(fn (Get $get): array => match ($get('status')) {
                    'triage' => [
                        'triage' => 'Triage',
                        'in_progress' => 'In Progress',
                        'backlog' => 'Backlog',
                    ],
                    'in_progress' => [
                        'in_progress' => 'In Progress',
                        'complete' => 'Complete',
                        'triage' => 'Triage',
                    ],
                    default => [
                        'triage' => 'Triage',
                        'in_progress' => 'In Progress',
                        'backlog' => 'Backlog',
                    ],
                })
            ]);
    }
return $form
            ->schema([
                Select::make('status')
                ->options(fn (Get $get): array => match ($get('status')) {
                    'triage' => [
                        'triage' => 'Triage',
                        'in_progress' => 'In Progress',
                        'backlog' => 'Backlog',
                    ],
                    'in_progress' => [
                        'in_progress' => 'In Progress',
                        'complete' => 'Complete',
                        'triage' => 'Triage',
                    ],
                    default => [
                        'triage' => 'Triage',
                        'in_progress' => 'In Progress',
                        'backlog' => 'Backlog',
                    ],
                })
            ]);
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dependent file upload option based on select field in form
FilamentFFilament / ❓┊help
2y ago
Persisting custom select field for dependent select.
FilamentFFilament / ❓┊help
3y ago
Set State of Select Field After Dynamically Populating Via Dependent Field
FilamentFFilament / ❓┊help
2y ago