mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
fix(web): use correct sliding window offset for search results (#20726)
The contents of search results are slightly offset by the search bar, search terms and spacing (margins/padding), and needs to be factored in when calculating whether an asset is visible or not. The offset was 0, which meant that assets were removed from view too early.
This commit is contained in:
parent
1193a23282
commit
89292fecb4
@ -52,6 +52,7 @@
|
||||
|
||||
let { isViewing: showAssetViewer } = assetViewingStore;
|
||||
const viewport: Viewport = $state({ width: 0, height: 0 });
|
||||
let searchResultsElement: HTMLElement | undefined = $state();
|
||||
|
||||
// The GalleryViewer pushes it's own history state, which causes weird
|
||||
// behavior for history.back(). To prevent that we store the previous page
|
||||
@ -362,6 +363,7 @@
|
||||
class="mb-12 bg-immich-bg dark:bg-immich-dark-bg m-4"
|
||||
bind:clientHeight={viewport.height}
|
||||
bind:clientWidth={viewport.width}
|
||||
bind:this={searchResultsElement}
|
||||
>
|
||||
{#if searchResultAlbums.length > 0}
|
||||
<section>
|
||||
@ -381,8 +383,8 @@
|
||||
onIntersected={loadNextPage}
|
||||
showArchiveIcon={true}
|
||||
{viewport}
|
||||
pageHeaderOffset={54}
|
||||
onReload={onSearchQueryUpdate}
|
||||
slidingWindowOffset={searchResultsElement.offsetTop}
|
||||
/>
|
||||
{:else if !isLoading}
|
||||
<div class="flex min-h-[calc(66vh-11rem)] w-full place-content-center items-center dark:text-white">
|
||||
|
Loading…
x
Reference in New Issue
Block a user