From adb6e06f9e332ad8bb8797ad2adee9875b1091d6 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 12 Feb 2024 16:25:26 -0300 Subject: [PATCH] Fix autofocus issues on comment components --- src/components/Textarea.svelte | 2 +- src/components/Thread.svelte | 1 + src/views/projects/Issue.svelte | 1 + src/views/projects/Patch.svelte | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Textarea.svelte b/src/components/Textarea.svelte index 70ff9c75d..7c719356b 100644 --- a/src/components/Textarea.svelte +++ b/src/components/Textarea.svelte @@ -41,7 +41,7 @@ }); afterUpdate(() => { - if (textareaElement) { + if (textareaElement && focus) { textareaElement.setSelectionRange(selectionStart, selectionEnd); textareaElement.focus(); } diff --git a/src/components/Thread.svelte b/src/components/Thread.svelte index 3d52954e0..5cd17d170 100644 --- a/src/components/Thread.svelte +++ b/src/components/Thread.svelte @@ -114,6 +114,7 @@
{/if}