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.
5 Replies
If you inspect the element in the browser dev tools, do you see a link with the correct url?
Solution
add:
->action(fn() => '')
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?
Yes, it needs to be
->reactive()
That works..many thanks!