From 1d8b37add17e847d39745aeb8c59c983ab7a1066 Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Thu, 16 Dec 2021 21:55:04 +0000 Subject: [PATCH] Set cursor at the end of the input --- static/index.html | 2 +- static/index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 84d2ee6..354888d 100644 --- a/static/index.html +++ b/static/index.html @@ -11,7 +11,7 @@ Stoatally different.
- +
diff --git a/static/index.js b/static/index.js index 6d0426b..b5d6470 100644 --- a/static/index.js +++ b/static/index.js @@ -3,6 +3,9 @@ window.onload = (event) => { const searchInput = document.getElementById('search'); + const length = searchInput.value.length; + searchInput.setSelectionRange(length, length); + searchInput.addEventListener('keyup', (e) => { console.log(searchInput.value);