Fix Enter behaviour on buttons

This commit is contained in:
Jonatan Kłosko 2021-07-01 17:06:06 +02:00
parent 48b4938408
commit 5637d09c09

View file

@ -306,7 +306,12 @@ function handleDocumentKeyDown(hook, event) {
restartRuntime(hook);
} else if (keyBuffer.tryMatch(["?"])) {
showShortcuts(hook);
} else if (keyBuffer.tryMatch(["i"]) || key === "Enter") {
} else if (
keyBuffer.tryMatch(["i"]) ||
(event.target === document.body &&
hook.state.focusedCellId &&
key === "Enter")
) {
cancelEvent(event);
enterInsertMode(hook);
} else if (keyBuffer.tryMatch(["j"])) {