fix(web): memory viewer jumps down on arrow keys

This commit is contained in:
Yaros 2025-06-21 12:57:34 +02:00
parent 798debfde3
commit ed7a2a3d44
2 changed files with 9 additions and 2 deletions

View File

@ -646,6 +646,7 @@
viewport={galleryViewport}
{assetInteraction}
slidingWindowOffset={viewerHeight}
arrowNavigation={false}
/>
</div>
</section>

View File

@ -41,6 +41,7 @@
onReload?: (() => void) | undefined;
pageHeaderOffset?: number;
slidingWindowOffset?: number;
arrowNavigation?: boolean;
}
let {
@ -58,6 +59,7 @@
onReload = undefined,
slidingWindowOffset = 0,
pageHeaderOffset = 0,
arrowNavigation = true,
}: Props = $props();
let { isViewing: isViewerOpen, asset: viewingAsset, setAssetId } = assetViewingStore;
@ -300,8 +302,12 @@
{ shortcut: { key: '?', shift: true }, onShortcut: handleOpenShortcutModal },
{ shortcut: { key: '/' }, onShortcut: () => goto(AppRoute.EXPLORE) },
{ shortcut: { key: 'A', ctrl: true }, onShortcut: () => selectAllAssets() },
...(arrowNavigation
? [
{ shortcut: { key: 'ArrowRight' }, preventDefault: false, onShortcut: focusNextAsset },
{ shortcut: { key: 'ArrowLeft' }, preventDefault: false, onShortcut: focusPreviousAsset },
]
: []),
];
if (assetInteraction.selectionActive) {