Can a suffixAction be triggered by pressing enter?
I have this form in a filament v3 Page:
I was expecting that the suffixAction will also be triggered by pressing the Enter key but is not the case. I could not find any mention to something like this in the Docs. I guess I am missing something very basic here...
2 Replies
Pressing Enter will typically try to submit the form. I guess this is a personal preference but I don't think it's a good idea to break that expectation.
I think you can do Tab + Enter to switch focus and trigger the action, if that makes sense.
Yeah I understand that is not the common case than the suffix action is the same as submitting the form. But I really need the suffix action for mobile and still being able to submit it with enter in desktop. After all this is a chat application and there is only one input field. I was hopping for a way to overwrite the default behaviour. Seems like I would have to find a work around.
Thanks for your reply!