From 8c829fde46f8873a2ddfb9a0bbaadfc8438c36bd Mon Sep 17 00:00:00 2001 From: scampower3 <81431263+scampower3@users.noreply.github.com> Date: Thu, 23 May 2024 22:01:07 +0800 Subject: [PATCH] Update src/controllers/lyrics.js Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> --- src/controllers/lyrics.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/controllers/lyrics.js b/src/controllers/lyrics.js index f0627f6e10..7953d0f8e8 100644 --- a/src/controllers/lyrics.js +++ b/src/controllers/lyrics.js @@ -73,12 +73,9 @@ export default function (view) { if (lyric) { lyric.classList.remove('pastLyric'); lyric.classList.remove('futureLyric'); - if (autoScroll === AutoScrollType.Smooth) { - scrollManager.scrollToElement(lyric, true); - } - if (autoScroll === AutoScrollType.Instant) { + if (autoScroll !== AutoScrollType.NoScroll) { // instant scroll is used when the view is first loaded - scrollManager.scrollToElement(lyric, false); + scrollManager.scrollToElement(lyric, autoScroll === AutoScrollType.Smooth); autoScroll = AutoScrollType.Smooth; } }