extend onSubmit to press of button for useSearchField #3689
-
I was wondering what would be the most efficient way to extend the ability to trigger the onSubmit callback when using a submit button as well. Thanks again for this fantastic library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I'm not quite sure what you're asking for. onSubmit is a form event. https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event so you wouldn't put it on a button. You'd put it on a form and you'd have a submit button inside that form. |
Beta Was this translation helpful? Give feedback.
I'm not quite sure what you're asking for. onSubmit is a form event. https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event so you wouldn't put it on a button. You'd put it on a form and you'd have a submit button inside that form.
Let me know if that answers your question.