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