Aug 7, 2024
0
Level 14
Replace Tooltip "Copy" with "Copied" after copied to Clipboard
I think Filament uses ryangjchandler/alpine-tooltip which uses Tippy. I am using a suffixAction clipboard icon and want to replace the tooltip content "Copy" with "Copied" once the user has clicked on a clipboard icon? How can I access that element? It seems tricky. I can set a notification instead, but I'd rather update the tooltip content.
->suffixAction(function (Get $get) {
return \Filament\Forms\Components\Actions\Action::make('Copy')
->tooltip('Copy Link')
->icon('heroicon-s-clipboard')
->action(function (Component $livewire, $state) {
$livewire->dispatch('copy-to-clipboard', text: $state);
Notification::make()
->success()
->title('Copied')
->body("Link copied to clipboard.")
->send();
});
})
Please or to participate in this conversation.