mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-21 22:27:56 +01:00
Fix safari issue in positioning text editor cursor
This commit is contained in:
parent
eb79dab117
commit
bb2b65ef47
@ -246,12 +246,12 @@ class MultilineTextEditor extends Events {
|
||||
|
||||
private _positionCursor(textareaElem: JQuery<HTMLTextAreaElement>, selectText: boolean) {
|
||||
textareaElem.focus();
|
||||
const lengh = this._getTextAreaText().length;
|
||||
const { length } = this._getTextAreaText();
|
||||
if (selectText) {
|
||||
// Mark text as selected ...
|
||||
textareaElem[0].setSelectionRange(0, lengh);
|
||||
textareaElem[0].setSelectionRange(0, length);
|
||||
} else {
|
||||
textareaElem.focus();
|
||||
textareaElem[0].setSelectionRange(length, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user