From bab5bc8318075232f226b00499173cbfbab45b6c Mon Sep 17 00:00:00 2001 From: Quentin ANIERE Date: Thu, 14 Apr 2022 15:39:24 +0200 Subject: [PATCH] Add autofocus --- src/index.html | 2 +- src/script.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index 7ef97d8..e2bee68 100644 --- a/src/index.html +++ b/src/index.html @@ -53,7 +53,7 @@ - + diff --git a/src/script.js b/src/script.js index aec111a..9e9fd06 100644 --- a/src/script.js +++ b/src/script.js @@ -29,7 +29,7 @@ document.addEventListener("DOMContentLoaded", () => { }); socket.on("new-message", (data) => { - + if(data.author != username) { document.getElementById("ringtone").play(); } @@ -65,6 +65,7 @@ const swiper = new Swiper('.swiper', { document.getElementById("chat-button").addEventListener("click", () => { document.getElementById("chat").style.display = "block"; + document.getElementById("message-input").focus(); }); document.getElementById("close").addEventListener("click", () => {