From faa21266db9baf485055dde4b64626ff72184771 Mon Sep 17 00:00:00 2001 From: BlueGreenMagick Date: Mon, 9 May 2022 10:15:56 +0900 Subject: [PATCH] Fix caret jumping to start when unselecting autocomplete suggestion (#1844) --- ts/editor/tag-editor/TagEditor.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/editor/tag-editor/TagEditor.svelte b/ts/editor/tag-editor/TagEditor.svelte index c7962d683..527688f3d 100644 --- a/ts/editor/tag-editor/TagEditor.svelte +++ b/ts/editor/tag-editor/TagEditor.svelte @@ -90,7 +90,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const activeTag = tagTypes[active!]; activeName = selected ?? activeTag.name; - activeInput.setSelectionRange(Infinity, Infinity); + const inputEnd = activeInput.value.length; + activeInput.setSelectionRange(inputEnd, inputEnd); } async function updateTagName(tag: TagType): Promise {