= ({
return (
);
diff --git a/src/components/RichTextEditor/styles.ts b/src/components/RichTextEditor/styles.ts
index f16c939f8..726e9e66a 100644
--- a/src/components/RichTextEditor/styles.ts
+++ b/src/components/RichTextEditor/styles.ts
@@ -102,10 +102,15 @@ const useStyles = makeStyles(
boxShadow: `inset 0px 0px 0 2px ${theme.palette.primary.main}`
},
rootDisabled: {
- ...theme.overrides.MuiOutlinedInput.root["&$disabled"]["& fieldset"]
+ ...theme.overrides.MuiOutlinedInput.root["&$disabled"]["& fieldset"],
+ background: theme.palette.background.default,
+ color: theme.palette.saleor.main[4]
},
rootError: {
borderColor: theme.palette.error.main
+ },
+ rootStatic: {
+ fontSize: theme.typography.body1.fontSize
}
};
},
diff --git a/src/components/RichTextEditor/utils.ts b/src/components/RichTextEditor/utils.ts
new file mode 100644
index 000000000..41b33ba4f
--- /dev/null
+++ b/src/components/RichTextEditor/utils.ts
@@ -0,0 +1,9 @@
+import EditorJS from "@editorjs/editorjs";
+
+export async function clean(editor: EditorJS) {
+ if (editor) {
+ // Prevents race conditions
+ await editor.isReady;
+ editor.destroy();
+ }
+}
diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap
index df6008c7b..dabfbff7a 100644
--- a/src/storybook/__snapshots__/Stories.test.ts.snap
+++ b/src/storybook/__snapshots__/Stories.test.ts.snap
@@ -13151,6 +13151,25 @@ exports[`Storyshots Generics / Rich text editor error 1`] = `
`;
+exports[`Storyshots Generics / Rich text editor static 1`] = `
+
+`;
+
exports[`Storyshots Generics / Save filter tab default 1`] = `
void;
@@ -12,7 +16,7 @@ function useRichText(opts: {
useEffect(() => {
if (opts.initial === null) {
- data.current = { blocks: [] };
+ data.current = emptyContent;
setLoaded(true);
return;
}