fix gallery modal next/prev button navigation

This commit is contained in:
Ryan Meador
2026-01-08 17:31:21 -05:00
parent ae357a5e49
commit 383898eae7
3 changed files with 82 additions and 5 deletions
+4
View File
@@ -63,6 +63,10 @@ function selected_gallery_index() {
const button = selected_gallery_button();
let result = -1;
buttons.forEach((v, i) => { if (v === button) { result = i; } });
if (result === -1 && gradioApp().getElementById('tab-gallery-search')?.checkVisibility()) {
const gallerySelection = window.getGallerySelection?.();
if (gallerySelection && Number.isInteger(gallerySelection.index)) result = gallerySelection.index;
}
return result;
}