From b1cd0dad8de62629864daba222aac15273f11a09 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Sun, 27 Apr 2025 19:36:08 +0000 Subject: [PATCH] site: adjust cursor position after search autocompletion --- public/js/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/js/app.js b/public/js/app.js index 9e158f7..03273cf 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -63,6 +63,10 @@ document.addEventListener('alpine:init', () => { this.$refs.tags.value = mySplice(value, pos, this.query.length, tag + ' '); this.reset(); + this.inputCursor = + this.$refs.tags.selectionStart = + this.$refs.tags.selectionEnd = + pos + tag.length + 1; this.$refs.tags.focus(); // Don't switch focus if we're completing after a Tab press.