Skip to content

Commit 2563f92

Browse files
committed
Prevent update selected styles when text changes (GB mode)
Gutenberg already controls the selected styles so we need to prevent Aztec modifying them when text changes.
1 parent b77a91a commit 2563f92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,10 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
10481048
}
10491049

10501050
onSelectionChangedListener?.onSelectionChanged(selStart, selEnd)
1051-
setSelectedStyles(getAppliedStyles(selStart, selEnd))
1051+
// Gutenberg controls the selected styles so we need to prevent Aztec to modify them
1052+
if (!isInGutenbergMode) {
1053+
setSelectedStyles(getAppliedStyles(selStart, selEnd))
1054+
}
10521055

10531056
isLeadingStyleRemoved = false
10541057
}

0 commit comments

Comments
 (0)