Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery Close Detailed View Programmatically #10750

Closed
1 task done
Josef-Ouano opened this issue Mar 7, 2025 · 1 comment
Closed
1 task done

Gallery Close Detailed View Programmatically #10750

Josef-Ouano opened this issue Mar 7, 2025 · 1 comment

Comments

@Josef-Ouano
Copy link

Josef-Ouano commented Mar 7, 2025

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
Close the detailed window when Gallery is returned as an output of a event listener function.

Describe the solution you'd like
As a parameter of the Gallery component would be nice.

Additional context
Just for context, I have a program where I delete Images from the Gallery.
So what I do is:
Select Image from Gallery -> Detailed View Opens -> Delete Image using a "Delete" button I defined -> Gallery is returned from the "Delete" button.click event

Detailed View stays open, and the next image gets loaded into Detailed View, but no event (select or change) gets triggered, meaning I don't have a reference to the image that got loaded to the Detailed View. What I want to happen is that at least when the Gallery gets returned, the Detailed View is closed down as to say that no new image has been selected, and the user has to select another one.

Even a workaround is ok for me at least right now.

@Josef-Ouano Josef-Ouano changed the title Gallery Close Preview Mode Programmatically Gallery Close Detailed Mode Programmatically Mar 7, 2025
@Josef-Ouano Josef-Ouano changed the title Gallery Close Detailed Mode Programmatically Gallery Close Detailed View Programmatically Mar 7, 2025
@abidlabs
Copy link
Member

abidlabs commented Mar 7, 2025

Hi @Josef-Ouano in your function, instead of returning just the value for the Gallery, return gr.Gallery(preview=True), see https://www.gradio.app/docs/gradio/gallery#param-gallery-preview

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants