Skip to content

Commit e113a68

Browse files
committed
Disable line break on enter key in message input
1 parent 3f046f9 commit e113a68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/js/chat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,14 @@ window.onload = async () => {
397397
message_input.addEventListener(`keydown`, async (evt) => {
398398
if (prompt_lock) return;
399399
if (evt.keyCode === 13 && !evt.shiftKey) {
400+
evt.preventDefault();
400401
console.log('pressed enter');
401402
await handle_ask();
402403
} else {
403404
message_input.style.removeProperty('height');
404405
message_input.style.height = (message_input.scrollHeight+4) + 'px';
405406
}
406-
});
407+
});
407408

408409
send_button.addEventListener(`click`, async () => {
409410
console.log('clicked send');

0 commit comments

Comments
 (0)