You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are times where you might want to submit a form programmatically from an external component, or a special event, like submitting on enter keyDown from a <textarea />, which isn't the default behavior. onSubmit calls event.preventDefault() isn't needed in this case, so we would need to break out a separate submit method, which doesn't rely on the presence of event.
I tried using refs and doing findDOMNode(this.refs.form).submit(), but the form submits (and refreshes the page) without triggering the internal onSubmit callback, which prevents default 😕
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
There are times where you might want to submit a form programmatically from an external component, or a special event, like submitting on enter
keyDown
from a<textarea />
, which isn't the default behavior.onSubmit
callsevent.preventDefault()
isn't needed in this case, so we would need to break out a separatesubmit
method, which doesn't rely on the presence ofevent
.Example:
I tried using refs and doing
findDOMNode(this.refs.form).submit()
, but the form submits (and refreshes the page) without triggering the internalonSubmit
callback, which prevents default 😕The text was updated successfully, but these errors were encountered: