mirror of
https://github.com/logos-messaging/logos-messaging-frontend.git
synced 2026-01-02 13:53:13 +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 () => {
|
||||
try {
|
||||
const name = await CreateUser(usernameInput);
|
||||
@ -456,6 +463,7 @@ function App() {
|
||||
<Input
|
||||
value={newMessage}
|
||||
onChange={updateMessage}
|
||||
onKeyDown={checkForEnter}
|
||||
placeholder="Input your message"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user