lightbox: Use single keydown handler for toggling overlay.

We use the same "v" key for opening and closing the
lightbox overlay.

We already have code to open and close the lightbox
overlay in hotkey.ts.

Having another keydown handler for closing the overlay
resulted in a bug where the overlay was just not being
opened because the second handler was immediately called
to close the overlay was immediately called after the first.

Fixes #35868.

(cherry picked from commit 6ab670bdee)
This commit is contained in:
Sahil Batra
2025-08-28 15:47:37 +05:30
committed by Tim Abbott
parent 53ace27db1
commit d718ec8920

View File

@@ -106,9 +106,6 @@ export class PanZoomControl {
case "-":
this.zoomOut();
break;
case "v":
overlays.close_overlay("lightbox");
break;
}
e.preventDefault();
e.stopPropagation();