F
Filament13mo ago
3rgo

Disabled action tooltip does not show

I'm working on a form (inside a custom page FWIW) with an action that is disabled dynamically depending on the form state. I would like to show a tooltip only when my action is disabled, to inform the user of why it is disabled, so I've injected the state of the current action to vary my tooltip content :
Action::make(__('pages.apply.submit'))
->icon('fas-paper-plane')
->color('success')
->disabled(fn ($livewire) => $livewire->isDirty())
->tooltip(fn (Action $action) => $action->isDisabled() ? __('pages.apply.submit_confirmation_disabled') : null)
Action::make(__('pages.apply.submit'))
->icon('fas-paper-plane')
->color('success')
->disabled(fn ($livewire) => $livewire->isDirty())
->tooltip(fn (Action $action) => $action->isDisabled() ? __('pages.apply.submit_confirmation_disabled') : null)
But when the action is disabled the tooltip does not show. If I remove the condition and set the tooltip text unconditionally, it show when the action is enabled and does not show when the action is disabled. Did I do something wrong, or is this expected behavior ? If this is expected, is there a workaround ? Thanks
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server