Improve reinit/resize handling.

This commit is contained in:
Dermot Duffy
2022-07-23 10:54:07 -07:00
parent 325abdfdd8
commit 6010d7b1e1
5 changed files with 109 additions and 62 deletions
+1 -7
View File
@@ -80,13 +80,7 @@ export class FrigateCardThumbnailCarousel extends LitElement {
* Handle gallery resize.
*/
protected _resizeHandler(): void {
this._refCarousel.value?.carouselReInit();
// Reinit will cause the scroll position to reset, so re-scroll to the
// correct location.
if (this._selected !== null) {
this._refCarousel.value?.carouselScrollTo(this._selected);
}
this._refCarousel.value?.carouselReInitWhenSafe();
}
/**