fix: matchesNode error in destroyed editor transaction
This commit is contained in:
@@ -457,11 +457,14 @@ export class Editor extends React.PureComponent<
|
||||
state: this.createState(this.props.value),
|
||||
editable: () => !this.props.readOnly,
|
||||
nodeViews: this.nodeViews,
|
||||
dispatchTransaction(transaction) {
|
||||
dispatchTransaction(this: EditorView, transaction) {
|
||||
if (this.isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
// callback is bound to have the view instance as its this binding
|
||||
const { state, transactions } = (
|
||||
this.state as EditorState
|
||||
).applyTransaction(transaction);
|
||||
const { state, transactions } =
|
||||
this.state.applyTransaction(transaction);
|
||||
|
||||
this.updateState(state);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user