-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
This is about our Markdown dependency carta. It provides API for registering keyboard shortcuts, however there's a bug somewhere: either in our implementation, or in carta itself. The key binds are not registering consistently. So you would hit either of the "shortcuts," and nothing would happen.
The bug is seemingly random.
<script lang="ts">
import type { Plugin, KeyboardShortcut } from "carta-md";
import { Carta, Markdown, MarkdownEditor } from "carta-md";
const enter: KeyboardShortcut = {
id: "newline",
combination: new Set(["enter"]),
action: (input) => {
input.insertAt(input.getCursorXY().right, "\n");
input.update();
},
};
const shiftEnter: KeyboardShortcut = {
id: "submit",
combination: new Set(["shift", "enter"]),
action: (input) => dispatch("shutter", {}),
};
const shortcuts = (): Plugin => {
return {
shortcuts: [enter, shiftEnter],
};
};
const carta = new Carta({
sanitizer: DOMPurify.sanitize,
disablePrefixes: true,
disableTabOuts: true,
extensions: [shortcuts()],
});
</script>Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog