mirror of https://github.com/heyman/heynote.git
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