fix: 修复已设置了字体样式的节点,在清空后再输入文本,节点的字体样式变成了主题样式的bug

This commit is contained in:
wangqi01 2024-11-08 19:28:15 +08:00
parent 4e6688e4e0
commit 7d101123d6

View File

@ -540,8 +540,8 @@ class RichText {
// 如果编辑过程中删除所有字符,那么会丢失主题的样式
if (len <= 0 || (len === 1 && contents.ops[0].insert === '\n')) {
this.lostStyle = true
// 需要删除节点的样式数据
this.syncFormatToNodeConfig(null, true)
// // 需要删除节点的样式数据
// this.syncFormatToNodeConfig(null, true)
} else if (this.lostStyle && !this.isCompositing) {
// 如果处于样式丢失状态,那么需要进行格式化加回样式
this.setTextStyleIfNotRichText(this.node)