From a4f637eda0ce1787410a89c58aa81afb26360473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Mon, 4 Nov 2019 17:56:24 +0100 Subject: [PATCH] send by enter by default --- main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 95176f0..8adbe44 100644 --- a/main.js +++ b/main.js @@ -15,7 +15,8 @@ if (document.querySelector('.modal__form-submit')) { } document.querySelector('.form__input-message').addEventListener('keydown', function (e) { - if (e.ctrlKey && e.keyCode === 13) { + if (!e.ctrlKey && e.keyCode === 13) { + e.preventDefault(); document.querySelector('.form__input-submit').click() } });