diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index d704e3d..036283b 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20015,6 +20015,13 @@ class PlexMeetsHomeAssistant extends HTMLElement { }; this.loadInitialData = async () => { window.addEventListener('scroll', () => { + if (this.detailsShown && + this.activeMovieElem && + this.getTop() + 15 < parseInt(this.activeMovieElem.style.top, 10)) { + window.scroll({ + top: getOffset(this.activeMovieElem).top - 80 + }); + } this.renderNewElementsIfNeeded(); }); window.addEventListener('resize', () => { diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 5cf5e21..03ff8ef 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -149,6 +149,15 @@ class PlexMeetsHomeAssistant extends HTMLElement { loadInitialData = async (): Promise => { window.addEventListener('scroll', () => { + if ( + this.detailsShown && + this.activeMovieElem && + this.getTop() + 15 < parseInt(this.activeMovieElem.style.top, 10) + ) { + window.scroll({ + top: getOffset(this.activeMovieElem as Element).top - 80 + }); + } this.renderNewElementsIfNeeded(); }); window.addEventListener('resize', () => {