From b94611b16080175de5b6224dc24dcefc8eb7b504 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 1 Nov 2020 21:04:58 +0100 Subject: [PATCH] Scroll page into view when selected item is outside view --- list-editor/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/list-editor/index.js b/list-editor/index.js index fdfd3c8..8dd00a6 100644 --- a/list-editor/index.js +++ b/list-editor/index.js @@ -507,6 +507,10 @@ function editor(root, inputData, options) { trigger('change') } + _.defer(() => { + $('.list-item.selected')[0].scrollIntoView({behavior: "smooth", block: "nearest"}) + }) + cursor.resetLastMove() return false