mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 21:03:57 +08:00
4fa580fbd1
This reverts commit 2abe85b834
.
11 lines
326 B
JavaScript
11 lines
326 B
JavaScript
export function setTextareaSelection(textarea, selectionStart, selectionEnd) {
|
|
textarea.selectionStart = selectionStart;
|
|
textarea.selectionEnd = selectionEnd;
|
|
}
|
|
|
|
export function getTextareaSelection(textarea) {
|
|
const start = textarea.selectionStart;
|
|
const end = textarea.selectionEnd;
|
|
return [start, end - start];
|
|
}
|