Skip to content

Commit

Permalink
fix(core): optmize code #WIK-4475
Browse files Browse the repository at this point in the history
  • Loading branch information
huanhuanwa committed Aug 3, 2021
1 parent 6ba9ce5 commit 210748a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/src/components/editable/editable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class SlateEditableComponent implements OnInit, OnChanges, OnDestroy {
}
const decorateChange = simpleChanges['decorate'];
if (decorateChange) {
this.detectContext();
this.forceFlush();
}
const readonlyChange = simpleChanges['readonly'];
if (readonlyChange) {
Expand Down Expand Up @@ -362,6 +362,8 @@ export class SlateEditableComponent implements OnInit, OnChanges, OnDestroy {
forceFlush() {
timeDebug('start data sync');
this.detectContext();
this.cdr.detectChanges();
this.toNativeSelection();
timeDebug('end data sync');
}

Expand Down Expand Up @@ -399,8 +401,6 @@ export class SlateEditableComponent implements OnInit, OnChanges, OnDestroy {
decorate: this.decorate,
readonly: this.readonly
};
this.cdr.detectChanges();
this.toNativeSelection();
}
}

Expand Down

0 comments on commit 210748a

Please sign in to comment.