From 1bb21144f0cd886869fd271d4f046d20b883ea04 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 31 Oct 2020 14:55:13 +0100 Subject: [PATCH] Allow other commands in textarea --- list-editor/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/list-editor/index.js b/list-editor/index.js index d7bbeef..11be6c5 100644 --- a/list-editor/index.js +++ b/list-editor/index.js @@ -424,8 +424,10 @@ function editor(root, inputData, options) { let dir = 0; if (event.key === 'ArrowUp') dir = -1 if (event.key === 'ArrowDown') dir = 1 - let cursorInfo = textareaCursorInfo(target, dir); - if (!cursorInfo.leaving) { + + let cursorInfo = null + if (target.nodeName === 'TEXTAREA') cursorInfo = textareaCursorInfo(target, dir); + if (cursorInfo !== null && !cursorInfo.leaving && dir !== 0) { return true }