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 }