mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 18:42:10 +00:00
artcraft: land on previous batch's last image when arrow-key paging left
PageDraw lightbox left-arrow at a batch boundary called openBatchInLightbox without a startIndex, defaulting to 0, so leftward traversal skipped every non-first image in each prior batch.
This commit is contained in:
1 parent
036aa3545f
commit
3e386a9127
1 file changed
+7
-1
@@ -159,7 +159,13 @@ const TextToImage = ({ imageMediaId, imageUrl }: TextToImageProps) => {
|
||||
|
||||
galleryModalLightboxNavPrev.value =
|
||||
batchIndex > 0
|
||||
? () => openBatchInLightbox(inverseBatchRef.current[batchIndex - 1])
|
||||
? () => {
|
||||
const prevBatch = inverseBatchRef.current[batchIndex - 1];
|
||||
openBatchInLightbox(
|
||||
prevBatch,
|
||||
Math.max(0, prevBatch.images.length - 1),
|
||||
);
|
||||
}
|
||||
: null;
|
||||
galleryModalLightboxNavNext.value =
|
||||
batchIndex < inverseBatchRef.current.length - 1
|
||||
|
||||
Reference in new issue
Block a user