© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Ehsan

Update TextInput programmatically in reactive way

Hello guys,

I have a reactive Select component on form and I want to update value of a TextInput based on the onchange value of this Select element.

I tried to use value() method, but it sets the value only once on load and doesn’t change on Select changes.

Please help.
Solution
Select::make('select')
    ->options([
        '1' => 'Option 1',
        '2' => 'Option 2',
    ])
    ->reactive()
    ->afterStateUpdated(fn ($state, $set) => $set('text', $state)),
TextInput::make('text')
Select::make('select')
    ->options([
        '1' => 'Option 1',
        '2' => 'Option 2',
    ])
    ->reactive()
    ->afterStateUpdated(fn ($state, $set) => $set('text', $state)),
TextInput::make('text')
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

TextInput afterStateUpdated() reactive weird behavior
FilamentFFilament / ❓┊help
3y ago
Update TextInput maxValue
FilamentFFilament / ❓┊help
3y ago
Update section heading programmatically
FilamentFFilament / ❓┊help
2y ago
Reactive field and afterStateUpdated is not update in realtime on Forms\Components\TextInput\Mask
FilamentFFilament / ❓┊help
3y ago