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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input event in gr.Dataframe is also triggered at function updates and at app start #8231

Open
1 task done
bergerchris opened this issue May 7, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@bergerchris
Copy link

Describe the bug

The input event of the dataframe should only be triggered, when the user makes inputs but it is also triggered at app startup and when a function makes changes.

Have you searched existing issues? 馃攷

  • I have searched and found no existing issues

Reproduction

import gradio as gr


def trigger():
    return "TRIGGER"

def change_df():
    return [['INPUT']]


with gr.Blocks() as demo:
    dataframe = gr.Dataframe(label="Name", interactive=True)
    textbox = gr.Textbox(label="Output Box", interactive=True)
    button = gr.Button('Change Dataframe')
  
    dataframe.input(fn=trigger, outputs=textbox)
    button.click(fn=change_df, outputs=dataframe)

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

Screenshot

No response

Logs

No response

System Info

Example from Gradio Playground

Severity

I can work around it

@bergerchris bergerchris added the bug Something isn't working label May 7, 2024
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

No branches or pull requests

1 participant