mirror of https://github.com/status-im/chat.git
Fix form submit
This commit is contained in:
parent
135bd9e14a
commit
972a898039
|
@ -60,7 +60,7 @@ const keyDownHandler = (e, typingEvent, setValue, value) => {
|
||||||
else if (e.keyCode === 13) {
|
else if (e.keyCode === 13) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const form = ChatRoomForm.current;
|
const form = ChatRoomForm.current;
|
||||||
form.dispatchEvent(new Event("submit"));
|
form.submitForm();
|
||||||
}
|
}
|
||||||
typingEvent(e)
|
typingEvent(e)
|
||||||
};
|
};
|
||||||
|
@ -152,6 +152,7 @@ class ChatRoom extends Component {
|
||||||
))}
|
))}
|
||||||
</AutoScrollList>
|
</AutoScrollList>
|
||||||
<Formik
|
<Formik
|
||||||
|
ref={ChatRoomForm}
|
||||||
initialValues={{ chatInput: '' }}
|
initialValues={{ chatInput: '' }}
|
||||||
onSubmit={(values, { setSubmitting, resetForm }) => {
|
onSubmit={(values, { setSubmitting, resetForm }) => {
|
||||||
const { chatInput } = values;
|
const { chatInput } = values;
|
||||||
|
@ -170,7 +171,7 @@ class ChatRoom extends Component {
|
||||||
setFieldValue
|
setFieldValue
|
||||||
}) => (
|
}) => (
|
||||||
<div className="chat-input">
|
<div className="chat-input">
|
||||||
<form onSubmit={handleSubmit} style={formStyle} ref={ChatRoomForm}>
|
<form onSubmit={handleSubmit} style={formStyle}>
|
||||||
<Button onClick={(e) => this.uploadFileDialog()}><AddCircle /></Button>
|
<Button onClick={(e) => this.uploadFileDialog()}><AddCircle /></Button>
|
||||||
<TextField
|
<TextField
|
||||||
id="chatInput"
|
id="chatInput"
|
||||||
|
|
Loading…
Reference in New Issue