fix: FindAndReplace does not update to reflect changing between readOnly/editable

This commit is contained in:
Tom Moor
2023-12-05 21:38:54 -05:00
parent 9fbe256807
commit 8d65b13b3d
4 changed files with 6 additions and 6 deletions

View File

@@ -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 = () => (
<FindAndReplace readOnly={this.editor.props.readOnly} />
public widget = ({ readOnly }: WidgetProps) => (
<FindAndReplace readOnly={readOnly} />
);
private results: { from: number; to: number }[] = [];