mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 15:51:23 +02:00
Fix paste handler in Editor.tsx
This commit is contained in:
@@ -329,10 +329,18 @@ function getExtensions({
|
|||||||
return [
|
return [
|
||||||
// NOTE: These *must* be anonymous functions so the references update properly
|
// NOTE: These *must* be anonymous functions so the references update properly
|
||||||
EditorView.domEventHandlers({
|
EditorView.domEventHandlers({
|
||||||
focus: () => onFocus.current?.(),
|
focus: () => {
|
||||||
blur: () => onBlur.current?.(),
|
onFocus.current?.();
|
||||||
keydown: (e) => onKeyDown.current?.(e),
|
},
|
||||||
paste: (e) => onPaste.current?.(e.clipboardData?.getData('text/plain') ?? ''),
|
blur: () => {
|
||||||
|
onBlur.current?.();
|
||||||
|
},
|
||||||
|
keydown: (e) => {
|
||||||
|
onKeyDown.current?.(e);
|
||||||
|
},
|
||||||
|
paste: (e) => {
|
||||||
|
onPaste.current?.(e.clipboardData?.getData('text/plain') ?? '');
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
tooltips({ parent }),
|
tooltips({ parent }),
|
||||||
keymap.of(singleLine ? defaultKeymap.filter((k) => k.key !== 'Enter') : defaultKeymap),
|
keymap.of(singleLine ? defaultKeymap.filter((k) => k.key !== 'Enter') : defaultKeymap),
|
||||||
|
|||||||
Reference in New Issue
Block a user