mirror of
https://github.com/logos-messaging/logos-messaging-frontend.git
synced 2026-01-04 06:43:08 +00:00
submit messages on enter
This commit is contained in:
parent
97f1ae78ff
commit
4a6d3bfe09
@ -212,6 +212,13 @@ function App() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const checkForEnter = (e: any) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
sendMessage()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const createUser = async () => {
|
const createUser = async () => {
|
||||||
try {
|
try {
|
||||||
const name = await CreateUser(usernameInput);
|
const name = await CreateUser(usernameInput);
|
||||||
@ -456,6 +463,7 @@ function App() {
|
|||||||
<Input
|
<Input
|
||||||
value={newMessage}
|
value={newMessage}
|
||||||
onChange={updateMessage}
|
onChange={updateMessage}
|
||||||
|
onKeyDown={checkForEnter}
|
||||||
placeholder="Input your message"
|
placeholder="Input your message"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
autoCorrect="off"
|
autoCorrect="off"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user