Skip to content

Commit

Permalink
fix: fix deFocus issue with this.currRt
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Jan 24, 2025
1 parent 131166a commit cd194e8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -804,16 +804,15 @@ export class RichTextEditPlugin implements IPlugin {
}

protected deFocus(trulyDeFocus = false) {
const target = this.currRt as IRichText;
if (!target) {
const currRt = this.currRt as IRichText;
if (!currRt) {
return;
}
this.updateCbs && this.updateCbs.forEach(cb => cb('beforeDefocus', this, { trulyDeFocus }));
if (trulyDeFocus) {
this.trySyncPlaceholderToTextConfig();
target.detachShadow();
currRt.detachShadow();
}
const currRt = this.currRt;
this.currRt = null;
if (this.editLine) {
this.editLine.parent && this.editLine.parent.removeChild(this.editLine);
Expand Down

0 comments on commit cd194e8

Please sign in to comment.