gugdun 9 месяцев назад
Родитель
Сommit
663e5f59c5
2 измененных файлов с 5 добавлено и 9 удалено
  1. 1 1
      package.json
  2. 4 8
      src/views/chat.ejs

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "svin-chat",
-  "version": "1.0.2",
+  "version": "1.0.3",
   "description": "Coolest chat in the world 😎",
   "main": "src/index.js",
   "scripts": {

+ 4 - 8
src/views/chat.ejs

@@ -64,8 +64,7 @@
         container.appendChild(textSpan)
         container.appendChild(datetimeSpan)
         messageList.insertBefore(container, target)
-        container.scrollIntoView(false)
-        version.scrollIntoView(false)
+        container.scrollIntoView()
     }
     function onMessageSubmit(event) {
         event.preventDefault()
@@ -127,14 +126,11 @@
         loadMoreRequest.send(JSON.stringify(data))
         return false
     }
-    function onMessageInputFocus(e) {
+    messageInput.addEventListener("focus", function (e) {
         setTimeout(function () {
-            version.scrollIntoView(false)
+            version.scrollIntoView()
         }, 500)
-    }
-    messageInput.addEventListener("focus", onMessageInputFocus)
-    messageInput.addEventListener("input", onMessageInputFocus)
-    window.addEventListener("native.showkeyboard", onMessageInputFocus)
+    })
     window.addEventListener("pageshow", function (e) {
         messageList.firstElementChild.scrollIntoView(false)
         pollMessages()