mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37: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) {
|
private _positionCursor(textareaElem: JQuery<HTMLTextAreaElement>, selectText: boolean) {
|
||||||
textareaElem.focus();
|
textareaElem.focus();
|
||||||
const lengh = this._getTextAreaText().length;
|
const { length } = this._getTextAreaText();
|
||||||
if (selectText) {
|
if (selectText) {
|
||||||
// Mark text as selected ...
|
// Mark text as selected ...
|
||||||
textareaElem[0].setSelectionRange(0, lengh);
|
textareaElem[0].setSelectionRange(0, length);
|
||||||
} else {
|
} else {
|
||||||
textareaElem.focus();
|
textareaElem[0].setSelectionRange(length, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user