Skip to content

Commit 9cd1615

Browse files
authored
Merge pull request #1038 from wordpress-mobile/fix/undo-when-deleting-placeholder
Make sure to save remove action to history
2 parents 7a5afb8 + a1d52e7 commit 9cd1615

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,6 +2205,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
22052205
}
22062206

22072207
fun removeMedia(attributePredicate: AttributePredicate) {
2208+
history.beforeTextChanged(this@AztecText)
22082209
text.getSpans(0, text.length, AztecMediaSpan::class.java)
22092210
.filter {
22102211
attributePredicate.matches(it.attributes)
@@ -2252,6 +2253,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
22522253
}
22532254
mediaSpan.onMediaDeleted()
22542255
}
2256+
contentChangeWatcher.notifyContentChanged()
22552257
}
22562258

22572259
fun replaceMediaSpan(aztecMediaSpan: AztecMediaSpan, predicate: (Attributes) -> Boolean) {

0 commit comments

Comments
 (0)