Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,18 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
this.uncaughtExceptionHandler = null
}

override fun setSelection(index: Int) {
if (index in 0..this.length()) {
super.setSelection(index)
} else if (index < 0) {
AppLog.e(AppLog.T.EDITOR, "Attempted to set selection to incorrect value $index")
setSelection(0)
} else if (index > this.length()) {
AppLog.e(AppLog.T.EDITOR, "Attempted to set selection to incorrect value $index")
setSelection(this.length())
}
}

override fun dispatchHoverEvent(event: MotionEvent): Boolean {
return if (accessibilityDelegate.onHoverEvent(event)) true else super.dispatchHoverEvent(event)
}
Expand Down