diff --git a/app/editor/extensions/FindAndReplace.tsx b/app/editor/extensions/FindAndReplace.tsx
index 81e32f778..f3c53782c 100644
--- a/app/editor/extensions/FindAndReplace.tsx
+++ b/app/editor/extensions/FindAndReplace.tsx
@@ -4,7 +4,7 @@ import { Command, Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
import * as React from "react";
import scrollIntoView from "smooth-scroll-into-view-if-needed";
-import Extension from "@shared/editor/lib/Extension";
+import Extension, { WidgetProps } from "@shared/editor/lib/Extension";
import FindAndReplace from "../components/FindAndReplace";
const pluginKey = new PluginKey("find-and-replace");
@@ -294,8 +294,8 @@ export default class FindAndReplaceExtension extends Extension {
];
}
- public widget = () => (
-
+ public widget = ({ readOnly }: WidgetProps) => (
+
);
private results: { from: number; to: number }[] = [];
diff --git a/app/editor/index.tsx b/app/editor/index.tsx
index 5171433f5..2c0346403 100644
--- a/app/editor/index.tsx
+++ b/app/editor/index.tsx
@@ -763,7 +763,7 @@ export class Editor extends React.PureComponent<
)}
{this.widgets &&
Object.values(this.widgets).map((Widget, index) => (
-
+
))}
diff --git a/shared/editor/lib/Extension.ts b/shared/editor/lib/Extension.ts
index 90552d832..ae0cfad0a 100644
--- a/shared/editor/lib/Extension.ts
+++ b/shared/editor/lib/Extension.ts
@@ -7,7 +7,7 @@ import { Editor } from "../../../app/editor";
export type CommandFactory = (attrs?: Record) => Command;
-export type WidgetProps = { rtl: boolean };
+export type WidgetProps = { rtl: boolean; readOnly: boolean | undefined };
export default class Extension {
options: any;
diff --git a/shared/editor/lib/ExtensionManager.ts b/shared/editor/lib/ExtensionManager.ts
index 4d7a89eee..e99103fd1 100644
--- a/shared/editor/lib/ExtensionManager.ts
+++ b/shared/editor/lib/ExtensionManager.ts
@@ -44,7 +44,7 @@ export default class ExtensionManager {
get widgets() {
return this.extensions
- .filter((extension) => extension.widget({ rtl: false }))
+ .filter((extension) => extension.widget({ rtl: false, readOnly: false }))
.reduce(
(nodes, node: Node) => ({
...nodes,