mirror of
https://github.com/heyman/heynote.git
synced 2024-11-21 23:43:22 +01:00
Support setting preventDefault to false in keymapFromSpec spec
This commit is contained in:
parent
37265d7796
commit
1b0b2d55b1
@ -23,7 +23,11 @@ import { formatBlockContent } from "./block/format-code.js"
|
||||
export function keymapFromSpec(specs) {
|
||||
return keymap.of(specs.map((spec) => {
|
||||
if (spec.run) {
|
||||
return {...spec, preventDefault: true}
|
||||
if ("preventDefault" in spec) {
|
||||
return spec
|
||||
} else {
|
||||
return {...spec, preventDefault: true}
|
||||
}
|
||||
} else {
|
||||
const [key, run] = spec
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user