mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
parent
a1125ddbf0
commit
99f652422f
1 changed files with 15 additions and 0 deletions
|
@ -459,6 +459,21 @@ export class MarkdownTextArea extends Component<
|
|||
}
|
||||
this.contentChange();
|
||||
this.setState(this.state);
|
||||
|
||||
textarea.focus();
|
||||
|
||||
if (start !== end) {
|
||||
textarea.setSelectionRange(
|
||||
start + beforeChars.length,
|
||||
end + afterChars.length
|
||||
);
|
||||
} else {
|
||||
textarea.setSelectionRange(
|
||||
start + beforeChars.length,
|
||||
end + emptyChars.length + afterChars.length
|
||||
);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
autosize.update(textarea);
|
||||
}, 10);
|
||||
|
|
Loading…
Reference in a new issue