Skip to content

Commit

Permalink
Merge pull request #949 from wordpress-mobile/update/gb-prevent-updat…
Browse files Browse the repository at this point in the history
…e-selected-styles-on-change

Prevent update selected styles when text changes on Gutenberg mode
  • Loading branch information
fluiddot authored Jan 5, 2022
2 parents b77a91a + 2563f92 commit a58cd77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,10 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
}

onSelectionChangedListener?.onSelectionChanged(selStart, selEnd)
setSelectedStyles(getAppliedStyles(selStart, selEnd))
// Gutenberg controls the selected styles so we need to prevent Aztec to modify them
if (!isInGutenbergMode) {
setSelectedStyles(getAppliedStyles(selStart, selEnd))
}

isLeadingStyleRemoved = false
}
Expand Down

0 comments on commit a58cd77

Please sign in to comment.