@@ -81,8 +81,9 @@ const resultWordsHistoryEl = qsr(".pageTest #resultWordsHistory");
8181
8282export let activeWordTop = 0 ;
8383export let activeWordHeight = 0 ;
84- export let lineTransition = false ;
85- export let currentTestLine = 0 ;
84+ let wordTopBeforeLineJump = 0 ;
85+ let lineTransition = false ;
86+ let currentTestLine = 0 ;
8687export let resultCalculating = false ;
8788
8889export function setResultCalculating ( val : boolean ) : void {
@@ -900,7 +901,14 @@ export async function updateWordLetters({
900901 if ( ! Config . showAllLines ) {
901902 const wordTopAfterUpdate = wordAtIndex . getOffsetTop ( ) ;
902903 if ( wordTopAfterUpdate > activeWordTop ) {
903- await lineJump ( activeWordTop , true ) ;
904+ let jump = false ;
905+ if ( ! lineTransition ) {
906+ wordTopBeforeLineJump = wordTopAfterUpdate ;
907+ jump = true ;
908+ } else if ( wordTopAfterUpdate > wordTopBeforeLineJump ) {
909+ jump = true ;
910+ }
911+ if ( jump ) await lineJump ( activeWordTop ) ;
904912 }
905913 }
906914 }
@@ -1160,19 +1168,13 @@ function removeTestElements(lastElementIndexToRemove: number): void {
11601168
11611169let currentLinesJumping = 0 ;
11621170
1163- export async function lineJump (
1164- currentTop : number ,
1165- force = false ,
1166- ) : Promise < void > {
1171+ async function lineJump ( currentTop : number , force = false ) : Promise < void > {
11671172 //last word of the line
11681173 if ( currentTestLine > 0 || force ) {
11691174 const hideBound = currentTop ;
11701175
11711176 const activeWordEl = getActiveWordElement ( ) ;
1172- if ( ! activeWordEl ) {
1173- // resolve();
1174- return ;
1175- }
1177+ if ( ! activeWordEl ) return ;
11761178
11771179 // index of the active word in all #words.children
11781180 // (which contains .word/.newline/.beforeNewline/.afterNewline elements)
0 commit comments