1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Sync focus with current playing lyrics

This commit is contained in:
LJQ 2024-05-24 21:32:20 +08:00
parent 15e35fa45f
commit 2d2ca357c1

View file

@ -14,6 +14,7 @@ import Events from '../utils/events.ts';
import '../styles/lyrics.scss'; import '../styles/lyrics.scss';
import { AutoScrollType } from './lyrics.types'; import { AutoScrollType } from './lyrics.types';
import focusManager from 'components/focusManager';
let currentPlayer; let currentPlayer;
let currentItem; let currentItem;
@ -76,6 +77,7 @@ export default function (view) {
if (autoScroll !== AutoScrollType.NoScroll) { if (autoScroll !== AutoScrollType.NoScroll) {
// instant scroll is used when the view is first loaded // instant scroll is used when the view is first loaded
scrollManager.scrollToElement(lyric, autoScroll === AutoScrollType.Smooth); scrollManager.scrollToElement(lyric, autoScroll === AutoScrollType.Smooth);
focusManager.focus(lyric);
autoScroll = AutoScrollType.Smooth; autoScroll = AutoScrollType.Smooth;
} }
} }