Skip to content

Commit

Permalink
fix: #1009 调整编辑器刷新时机,只有编辑器处于显示状态时才需要刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Dec 22, 2024
1 parent ccae682 commit 2b8696f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ export default class Editor {
this.domWidth = this.getEditorDom().offsetWidth;
// 监听编辑器宽度变化
const resizeObserver = new ResizeObserver((entries) => {
if (this.getEditorDom().offsetWidth !== this.domWidth) {
if (this.getEditorDom().offsetWidth !== this.domWidth && this.$cherry.status.editor === 'show') {
this.domWidth = this.getEditorDom().offsetWidth;
this.editor.refresh();
}
Expand Down

0 comments on commit 2b8696f

Please sign in to comment.