Disable action with tooltip
I want to show the reason why the action is disabled.
But if i disable it, the tooltip isn't shown.
What would u do?
I don't want to make the action to be enabled just to show the tooltip.
I want it not to be clickable but hoverable to be able to see the tooltip.
6 Replies
Here is one quick and dirty solution:
Just bail out. Im afraid otherwise you would need a custom view for the action where you wrap the trigger in another element. See this comment
lol u wont believe it just 2 seconds ago, when u modified the msg to add it, i added that class too
but if i have
requiresConfirmation()
it shows up the modal anyways π€requiresConfirmation
accepts a closure too, so whatever your reason is to disable can be applied to that too i supposemaybe modifying requires confirmation closure yeah
let me try
π« but im on a DeleteAction, lets dig into it and see how to handle it
oh, its just requiresConfirmation, ez, i override it
i guess all this changes could be wrapped in a new fn called
disabledWithTooltip
that would be a trait like the requires confirmation one but with the changes u shared me instead
so yeah it works, thanks for the help @disstoactions are `macroable' so its fair game to add a macro...if you were to use a trait you would need to extend an action π€
i tought more of a built in filament feature, ill checkout the github link u shared me, maybe i can try a PR
@dissto what do u think xd
https://github.com/filamentphp/filament/discussions/4271#discussioncomment-10125186