Skip to content

Commit 3344a14

Browse files
samuelreichertgjulivan
authored andcommitted
fix(rich-text-web): replace setContents with updateContents for consistency in Quill operations
1 parent 54ae606 commit 3344a14

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/pluggableWidgets/rich-text-web/src/components/CustomToolbars/useEmbedModal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function useEmbedModal(ref: MutableRefObject<Quill | null>): ModalReturnT
132132
onSubmit: (value: viewCodeConfigType) => {
133133
const newDelta = ref.current?.clipboard.convert({ html: value.src });
134134
if (newDelta) {
135-
ref.current?.setContents(newDelta, Emitter.sources.USER);
135+
ref.current?.updateContents(newDelta, Emitter.sources.USER);
136136
}
137137
closeDialog();
138138
},

packages/pluggableWidgets/rich-text-web/src/components/Editor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const Editor = forwardRef((props: EditorProps, ref: MutableRefObject<Quill | nul
7474
html: defaultValue
7575
});
7676
if (newContent && newContent !== ref.current?.getContents()) {
77-
ref.current?.setContents(newContent);
77+
ref.current?.updateContents(newContent);
7878
}
7979
}
8080
}, [ref, defaultValue]);

packages/pluggableWidgets/rich-text-web/src/utils/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function constructWrapperStyle(props: RichTextContainerProps): CSSPropert
3838
export function updateLegacyQuillFormats(quill: Quill): boolean {
3939
const results = transformLegacyQuillFormats(quill.getContents());
4040
if (results.isDirty) {
41-
quill.setContents(results.data, Quill.sources.USER);
41+
quill.updateContents(results.data, Quill.sources.USER);
4242
}
4343
return results.isDirty;
4444
}

0 commit comments

Comments
 (0)