feat(ui): allow navigating between images with arrows in preview dialog (#5669)

This commit is contained in:
mostapko 2026-03-01 03:30:47 +00:00 committed by GitHub
parent 664b8c5629
commit 104d2ec0a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,12 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls, initialIndex = 0 }: P
case "Escape":
onOpenChange(false);
break;
case "ArrowRight":
setCurrentIndex((prev) => Math.min(prev + 1, imgUrls.length - 1));
break;
case "ArrowLeft":
setCurrentIndex((prev) => Math.max(prev - 1, 0));
break;
default:
break;
}