fix(ui): stop media viewer Escape from closing underlying modal

This commit is contained in:
Will Miao
2026-08-18 20:51:56 +08:00
parent 5d1a22fb8f
commit fa58297973
2 changed files with 65 additions and 0 deletions
@@ -134,6 +134,10 @@ export function openMediaViewer(arg1, arg2, arg3) {
const keyHandler = (e) => {
if (e.key === 'Escape') {
// Stop propagation so bubble-phase handlers (e.g. ModalManager's
// Escape handler) do not also close the modal underneath.
e.stopPropagation();
e.preventDefault();
closeMediaViewer();
return;
}