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

gr.Image with tool="sketch" breaks completely after switching tabs #2224

Closed
1 task done
Tracked by #2232
AUTOMATIC1111 opened this issue Sep 10, 2022 · 0 comments · Fixed by #2144
Closed
1 task done
Tracked by #2232

gr.Image with tool="sketch" breaks completely after switching tabs #2224

AUTOMATIC1111 opened this issue Sep 10, 2022 · 0 comments · Fixed by #2144
Assignees
Labels
bug Something isn't working

Comments

@AUTOMATIC1111
Copy link

AUTOMATIC1111 commented Sep 10, 2022

Describe the bug

gr.Image with tool="sketch" stops working and shows a grey square after user switches tabs, which makes it impossible for user to use the element afterwards. There is no real workaround. I clear the image with javascript upon tab switch, which helps for this exact case, but users still experience this afterwards, so rather than workaround, this error needs to be fixed. Also the DOM tree in browser shows image as <img class="absolute w-full h-full object-contain" src="[object Object]" alt=""> so it's clearly some error in javascript.

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

import gradio as gr

with gr.Blocks(analytics_enabled=False) as demo:
    with gr.Tabs() as tabs:
        with gr.TabItem("A"):
            gr.Image(source="upload", interactive=True, type="pil", tool="sketch", image_mode="RGBA")

        with gr.TabItem("B"):
            gr.HTML()

demo.launch()

Screenshot

firefox_I6l3U9J0SH

Logs

does not produce messages

System Info

gradio 3.3, both firefox and chrome

Severity

blocking all usage of gradio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants