We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2629c6 commit cd49d3dCopy full SHA for cd49d3d
1 file changed
public/js/script.js
@@ -371,6 +371,16 @@ function updateCaretPosition() {
371
left: newLeft
372
}, duration)
373
374
+ let middlePos = (document.documentElement.clientHeight / 2);
375
+
376
+ if (newTop >= middlePos) {
377
+ window.scrollTo({
378
+ left: 0,
379
+ top: newTop - middlePos,
380
+ behavior: 'smooth'
381
+ })
382
+ }
383
384
}
385
386
function countChars() {
0 commit comments