We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The event listeners for the gr.Code component does not seem to work properly when used in a function with the gr.render decorator.
gr.Code
gr.render
Code.change
Code.input
Code.focus
Code.blur
These issues are not observed when using a gr.Textbox or a gr.TextArea.
gr.Textbox
gr.TextArea
import gradio as gr def identity(v): print(v) return v with gr.Blocks() as demo: show_checkbox = gr.Checkbox(label="Show", value=True) text_state = gr.State("Some text") @gr.render(inputs=[show_checkbox, text_state]) def render(show: bool, text: str) -> None: if not show: return text_input = gr.Code( value=text, ) text_input.input( fn=identity, inputs=[text_input], outputs=[text_state], ) demo.launch()
No response
Gradio Environment Information: ------------------------------ Operating System: Windows gradio version: 4.37.2 gradio_client version: 1.0.2 ------------------------------------------------ gradio dependencies in your environment: aiofiles: 23.2.1 altair: 5.3.0 fastapi: 0.111.0 ffmpy: 0.3.2 gradio-client==1.0.2 is not installed. httpx: 0.27.0 huggingface-hub: 0.23.3 importlib-resources: 6.4.0 jinja2: 3.1.3 markupsafe: 2.1.5 matplotlib: 3.9.0 numpy: 1.26.3 orjson: 3.10.5 packaging: 24.1 pandas: 2.2.2 pillow: 10.2.0 pydantic: 2.7.3 pydub: 0.25.1 python-multipart: 0.0.9 pyyaml: 6.0.1 ruff: 0.4.9 semantic-version: 2.10.0 tomlkit==0.12.0 is not installed. typer: 0.12.3 typing-extensions: 4.9.0 urllib3: 2.2.1 uvicorn: 0.30.1 authlib; extra == 'oauth' is not installed. itsdangerous; extra == 'oauth' is not installed. gradio_client dependencies in your environment: fsspec: 2024.2.0 httpx: 0.27.0 huggingface-hub: 0.23.3 packaging: 24.1 typing-extensions: 4.9.0 websockets: 11.0.3
I can work around it
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The event listeners for the
gr.Code
component does not seem to work properly when used in a function with thegr.render
decorator.Code.change
andCode.input
does not trigger properly, instead triggers only once per re-render.Code.change
,Code.input
,Code.focus
andCode.blur
does not return the entered code, instead returns the component's initial value.These issues are not observed when using a
gr.Textbox
or agr.TextArea
.Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: