Hint action disappear.

Forms\Components\Select::make('client_id')
->native(false)
->preload()
->live()
->relationship('client', 'title',
->required()
->afterStateUpdated(function (Forms\Components\Select $select, $state) {
$select->hintAction(
Forms\Components\Actions\Action::make('View Client Accoutnts')
->action(function () {
info('View Rate Card');
})
);
}
}),
Forms\Components\Select::make('client_id')
->native(false)
->preload()
->live()
->relationship('client', 'title',
->required()
->afterStateUpdated(function (Forms\Components\Select $select, $state) {
$select->hintAction(
Forms\Components\Actions\Action::make('View Client Accoutnts')
->action(function () {
info('View Rate Card');
})
);
}
}),
While I try to click on hint, it disappear.
Solution:
```php Select::make('client_id') ->options([ 1 => 'Option 1', 2 => 'Option 2',...
Jump to solution
4 Replies
LeandroFerreira
LeandroFerreira3mo ago
why are you adding the hintAction afterStateUpdated?
Asmit Nepali
Asmit Nepali3mo ago
@Leandro Ferreira thanks for the response, Actually I want to attach hintaAction after selected the option
Solution
LeandroFerreira
LeandroFerreira3mo ago
Select::make('client_id')
->options([
1 => 'Option 1',
2 => 'Option 2',
])
->live()
->hintAction(action: fn ($state) => filled($state) ?
Action::make('view_client')
->action(function () {
//...
}) : null)
Select::make('client_id')
->options([
1 => 'Option 1',
2 => 'Option 2',
])
->live()
->hintAction(action: fn ($state) => filled($state) ?
Action::make('view_client')
->action(function () {
//...
}) : null)
Asmit Nepali
Asmit Nepali3mo ago
Thank You! @Leandro Ferreira
Want results from more Discord servers?
Add your server