Skip to content

Commit 7f4d032

Browse files
committed
fix of #875
1 parent 4421879 commit 7f4d032

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/controls/richText/RichText.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,13 @@ export class RichText extends React.Component<IRichTextProps, IRichTextState> {
916916
const quill = this.getEditor();
917917
if (quill) {
918918
const range = quill.getSelection();
919-
const formats = quill.getFormat(range);
919+
if (range) {
920+
const formats = quill.getFormat(range);
920921

921-
if (!isEqual(formats, this.state.formats)) {
922-
console.log(`current format: ${formats.list}`);
923-
newState.formats = formats;
922+
if (!isEqual(formats, this.state.formats)) {
923+
console.log(`current format: ${formats.list}`);
924+
newState.formats = formats;
925+
}
924926
}
925927

926928
}

0 commit comments

Comments
 (0)