F
Filament12mo ago
rich06

suffixAction not working?

Using the form builder I have added a text input field for an url and literally copied the example from here https://filamentphp.com/docs/2.x/forms/fields#affixes for the suffixAction(). The icon renders fine but clicking on it does nothing... is there anything else required to make this work? Thanks.
Filament
Fields - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Solution:
add: ->action(fn() => '')...
Jump to solution
5 Replies
Patrick Boivin
Patrick Boivin12mo ago
If you inspect the element in the browser dev tools, do you see a link with the correct url?
Solution
toeknee
toeknee12mo ago
add: ->action(fn() => '')
rich06
rich0612mo ago
Thanks for the response but no - there is no <a> tag on inspection. It is only present once the data has been saved Thanks - that seems to add the link when the data is typed in but it won't change when the user types a new value... i.e. 1) user enters 'somesite.com' - link gets added to 'somesite.com' 2) user changes the link to 'anothersite.com' the link remains as 'somesite.com' until the data is save ... i.e. the fix only adds the link if the initial entry is empty... should it be reactive() or something?
Dennis Koch
Dennis Koch12mo ago
Yes, it needs to be ->reactive()
rich06
rich0612mo ago
That works..many thanks!