F
Filamentβ€’11mo ago
MikePageDev

Dynamic hint not updating

Hi I have a hint on a field that changes depending on a select field. I have this working in another app but cant seem to get it working in this one and for the life of me I cant figure out what I have done differently. here is a code example
use Filament\Forms\Get;

Select::make('selection')
->relationship('selection', 'tag',)
->preload()
->searchable()
->columnSpan(2),
TextInput::make('text_input')
->hint(function (Get $get) {
return $get($selection) ? '' : 'no selection';
})
->maxLength(255)
->columnSpan(2),
use Filament\Forms\Get;

Select::make('selection')
->relationship('selection', 'tag',)
->preload()
->searchable()
->columnSpan(2),
TextInput::make('text_input')
->hint(function (Get $get) {
return $get($selection) ? '' : 'no selection';
})
->maxLength(255)
->columnSpan(2),
For some reason the hint is not changing when an option is selected.
Solution:
So I have managed to fix this by adding live() to the select. But what I don't understand is how is it working in my other app without live()
Jump to solution
3 Replies
Solution
MikePageDev
MikePageDevβ€’11mo ago
So I have managed to fix this by adding live() to the select. But what I don't understand is how is it working in my other app without live()
Dennis Koch
Dennis Kochβ€’11mo ago
Good question πŸ˜… Does it really work live or just on page load?
MikePageDev
MikePageDevOPβ€’11mo ago
It works live I was just testing it πŸ˜•
Want results from more Discord servers?
Add your server