Skip to content

Commit 934fa0f

Browse files
committed
Do not reset selection when isInit is true
1 parent d570aca commit 934fa0f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,15 +1082,18 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
10821082
}
10831083

10841084
val cursorPosition = consumeCursorPosition(builder)
1085-
setSelection(0)
1085+
1086+
if (!isInit) {
1087+
setSelection(0)
1088+
}
10861089

10871090
setTextKeepState(builder)
10881091
enableTextChangedListener()
10891092

1090-
setSelection(cursorPosition)
1091-
10921093
if (isInit) {
10931094
initialEditorContentParsedSHA256 = calculateInitialHTMLSHA(toPlainHtml(false), initialEditorContentParsedSHA256)
1095+
} else {
1096+
setSelection(cursorPosition)
10941097
}
10951098

10961099
loadImages()

0 commit comments

Comments
 (0)