Giter VIP home page Giter VIP logo

Comments (6)

peeter2 avatar peeter2 commented on May 29, 2024 1

You are right, sorry about that, seems like the issue is fixed as I just updated gradio.

from gradio.

abidlabs avatar abidlabs commented on May 29, 2024

Can you please provide a minimal code example that we can use to reproduce the issue above? See: https://stackoverflow.com/help/minimal-reproducible-example

from gradio.

peeter2 avatar peeter2 commented on May 29, 2024

Minimal code example to test this.

import random

import gradio as gr


with gr.Blocks() as demo:
    gallery = gr.Gallery(value=
        ["https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Marc%2C_Franz_-_Blue_Horse_I_-_Google_Art_Project.jpg/449px-Marc%2C_Franz_-_Blue_Horse_I_-_Google_Art_Project.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Anna_Bili%C5%84ska-Bohdanowiczowa_-_At_the_seaside_-_MP_203_-_National_Museum_in_Warsaw.jpg/479px-Anna_Bili%C5%84ska-Bohdanowiczowa_-_At_the_seaside_-_MP_203_-_National_Museum_in_Warsaw.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Maison_devant_la_Sainte-Victoire_pr%C3%A8s_de_Gardanne%2C_par_Paul_C%C3%A9zanne%2C_Indianapolis_Museum_of_Art.jpg/741px-Maison_devant_la_Sainte-Victoire_pr%C3%A8s_de_Gardanne%2C_par_Paul_C%C3%A9zanne%2C_Indianapolis_Museum_of_Art.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/Adolph_Tidemand_%26_Hans_Gude_-_Bridal_Procession_on_the_Hardangerfjord_-_Google_Art_Project.jpg/839px-Adolph_Tidemand_%26_Hans_Gude_-_Bridal_Procession_on_the_Hardangerfjord_-_Google_Art_Project.jpg",
        ],
                label="Generated images", show_label=False, columns=[4], allow_preview=False, selected_index=1)
    selected_item = gr.Number(precision=0, label="selected gallery item")


    def get_select_index(evt: gr.SelectData):
        return evt.index
    gallery.select(get_select_index, None, selected_item)

if __name__ == "__main__":
    demo.launch()

As you can see, when the gallery has the parameter gr.Gallery(selected_index=1) for example then no matter which image I click on, the border highlight is still around the second image, even though the index change takes effect (except when I try to select the second image).
With the old version of Gradio the border changed fine to the correct image that was clicked on.

from gradio.

peeter2 avatar peeter2 commented on May 29, 2024

Hello. Just a gentle reminder on this. Is there a fix or a work around for this?

from gradio.

abidlabs avatar abidlabs commented on May 29, 2024

Hi @peeter2 havent had a chance to look at this yet, we’ll look into this as soon as we can!

from gradio.

abidlabs avatar abidlabs commented on May 29, 2024

Hi @peeter2 I took a look and I can't repro the issue you are describing. Are you sure you are running on the latest version of gradio? You can try installing gradio from main by following the instructions here: https://www.gradio.app/main/docs/interface

Screen.Recording.2024-04-21.at.12.03.26.AM.mov

from gradio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.