Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Prevent a scroll of the file list in the background

Manav Rathi099771dfe60a
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index 50651a3714..1457c50c85 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -1127,6 +1127,10 @@ export class FileViewerPhotoSwipe {
if (!isFocusedOnUIControl()) {
cb = handleTogglePlayIfPossible;
}
+ // Prevent the browser's default space behaviour of
+ // scrolling the file list in the background (which is
+ // not appropriate when the file viewer is visible).
+ if (e.target == document.body) e.preventDefault();
break;
case "Backspace":
case "Delete":