Skip to content

Commit fd160c5

Browse files
committed
Only automatically jump to input on resubmit
1 parent 503c93a commit fd160c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/checker/checker.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ try {
282282
multipleChoice = null;
283283
autocomplete.update();
284284
// Focus input element
285-
answerInput.focus();
285+
// answerInput.focus();
286286
}
287287

288288
// Check answer
@@ -1018,7 +1018,7 @@ try {
10181018
false,
10191019
);
10201020

1021-
target?.querySelector('input, textarea, math-field')?.focus();
1021+
// target?.querySelector('input, textarea, math-field')?.focus();
10221022

10231023
currentAnswerMode = mode;
10241024
}
@@ -1126,6 +1126,10 @@ try {
11261126
if (event.target.hasAttribute('data-flag-response')) return r.flagged ? unflagResponse(event) : flagResponse(event);
11271127
ui.view("");
11281128
await resubmitCheck(r);
1129+
window.scrollTo(0, document.body.scrollHeight);
1130+
setTimeout(() => {
1131+
document.querySelector(`[data-answer-mode="${r.mode === 'text' ? 'input' : r.mode}"]`)?.querySelector('input, textarea, math-field')?.focus();
1132+
}, 500);
11291133
});
11301134
});
11311135
if (sortedHistory.find(r => r.flagged)) {

0 commit comments

Comments
 (0)