Fix editor stale callbacks and recent item deletion

This commit is contained in:
Gregory Schier
2023-10-30 07:06:21 -07:00
parent 8a73636f43
commit 3b1e4f538d
9 changed files with 45 additions and 20 deletions

View File

@@ -267,10 +267,11 @@ function getExtensions({
: []),
// Handle onFocus
// NOTE: These *must* be anonymous functions so the references update properly
EditorView.domEventHandlers({
focus: onFocus.current,
blur: onBlur.current,
keydown: onKeyDown.current,
focus: () => onFocus.current?.(),
blur: () => onBlur.current?.(),
keydown: e => onKeyDown.current?.(e),
}),
// Handle onChange