Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix workaround

Manav Rathidfba8478b720
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index a8a1a109c2..0e0362b9e6 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -1327,18 +1327,16 @@ export class FileViewerPhotoSwipe {
*/
const blurMediaChromeFocus = (e: MouseEvent) => {
const target = e.target;
- if (
- target instanceof HTMLElement &&
- // A clickable media chrome element
- target.tagName.startsWith("MEDIA-") &&
- // Except the menu, which needs to retain focus to show itself
- // (presumably).
- target.tagName != "MEDIA-SETTINGS-MENU-ITEM"
- ) {
- // TODO: This doesn't quite work. figure.
- console.log(target.tagName);
- // setTimeout(() => target.blur(), 0);
- // setTimeout(resetFocus, 0);
+ if (target instanceof HTMLElement) {
+ switch (target.tagName) {
+ case "MEDIA-TIME-RANGE":
+ case "MEDIA-PLAY-BUTTON":
+ case "MEDIA-MUTE-BUTTON":
+ case "MEDIA-PIP-BUTTON":
+ case "MEDIA-FULLSCREEN-BUTTON":
+ setTimeout(() => target.blur(), 0);
+ break;
+ }
}
};