aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-19 16:00:47 -0500
committerGitHub <noreply@github.com>2020-12-19 16:00:47 -0500
commitbef8612665829b5b00cc049f3466057e89b52f1b (patch)
tree61022a8a8ff1bb8814a76c618e246afffb65fc95 /ext/mixed
parentd42b95a9c0ce5a6304906e7054200ae085b16700 (diff)
Focus the current entry earlier in the generation process (#1137)
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/display.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 9e2cd931..f600da63 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -879,6 +879,7 @@ class Display extends EventDispatcher {
}
let {sentence=null, optionsContext=null, focusEntry=null, scrollX=null, scrollY=null} = state;
+ if (typeof focusEntry !== 'number') { focusEntry = 0; }
if (!(typeof optionsContext === 'object' && optionsContext !== null)) {
optionsContext = this.getOptionsContext();
state.optionsContext = optionsContext;
@@ -943,9 +944,11 @@ class Display extends EventDispatcher {
entry.dataset.index = `${i}`;
this._addEntryEventListeners(entry);
container.appendChild(entry);
+ if (focusEntry === i) {
+ this._focusEntry(i, false);
+ }
}
- this._focusEntry(typeof focusEntry === 'number' ? focusEntry : 0, false);
if (typeof scrollX === 'number' || typeof scrollY === 'number') {
let {x, y} = this._windowScroll;
if (typeof scrollX === 'number') { x = scrollX; }