Skip to content

Commit d845fbf

Browse files
author
Gerardo
committed
Update handleBackspaceAndEnter to prevent removing the current styles when backspacing if Gutenberg mode is enabled and it's at the start of the EditText
1 parent e204002 commit d845fbf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,10 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
839839

840840
var wasStyleRemoved = false
841841
if (event.action == KeyEvent.ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_DEL) {
842+
if (isInGutenbergMode && (selectionStart == 0 && isTextSelected())) {
843+
return false
844+
}
845+
842846
if (!consumeHistoryEvent) {
843847
history.beforeTextChanged(this@AztecText)
844848
}

0 commit comments

Comments
 (0)