Fix url link selection placement. Fixes #155

This commit is contained in:
Dessalines 2021-02-02 11:45:38 -05:00
parent 27fd4a4626
commit 7d8f1a1ced

View file

@ -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);
}