From 7d8f1a1cedd457e45e8da16a72f64604157c7c53 Mon Sep 17 00:00:00 2001 From: Dessalines <tyhou13@gmx.com> Date: Tue, 2 Feb 2021 11:45:38 -0500 Subject: [PATCH] Fix url link selection placement. Fixes #155 --- src/shared/components/markdown-textarea.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/markdown-textarea.tsx b/src/shared/components/markdown-textarea.tsx index 21af02c..ded6dd1 100644 --- a/src/shared/components/markdown-textarea.tsx +++ b/src/shared/components/markdown-textarea.tsx @@ -422,11 +422,11 @@ export class MarkdownTextArea extends Component< start )}[${selectedText}]()${i.state.content.substring(end)}`; textarea.focus(); - setTimeout(() => (textarea.selectionEnd = end + 5), 10); + setTimeout(() => (textarea.selectionEnd = end + 3), 10); } else { i.state.content += '[]()'; textarea.focus(); - setTimeout(() => (textarea.selectionEnd -= 0), 10); + setTimeout(() => (textarea.selectionEnd -= 1), 10); } i.setState(i.state); } -- 2.44.1