You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gr.Textbox() display text and sent text mismatch. The display text is controlled by textarea.value, but the sent text is NOT.
Actually, I am trying to make the chatbot message support buttons. I made it to work by clicking on a button and the text box is updated with the button text. But after hitting ENTER, it still sends an empty string.
Obviously, it is texarea.value controls the display text of Textbox, Any one knows which attribute of textarea is actually sent to the chatbot?
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
The following is a simple app that sends messages to a chatbot and the chatbot responds with "I love you".
importgradioasgrdefbot(history, msg):
returnhistory+ [[msg, 'I love you']], ""withgr.Blocks() asdemo:
chatbot=gr.Chatbot()
msg=gr.Textbox(show_label=False,
placeholder="Enter text and press ENTER", container=False, elem_id="inputTextBox")
msg.submit(bot, [chatbot, msg], [chatbot, msg])
demo.launch()
If you type in "foo" in the Textbox, open the browser console and run the following Javascript:
Thanks @taoari by the way, for general questions like this (that are not feature requests or bug reports), please ask in our Forums or our Discord. (I'll close this issue)
Describe the bug
gr.Textbox() display text and sent text mismatch. The display text is controlled by
textarea.value
, but the sent text is NOT.Actually, I am trying to make the chatbot message support buttons. I made it to work by clicking on a button and the text box is updated with the button text. But after hitting ENTER, it still sends an empty string.
Obviously, it is
texarea.value
controls the display text of Textbox, Any one knows which attribute of textarea is actually sent to the chatbot?Have you searched existing issues? 🔎
Reproduction
The following is a simple app that sends messages to a chatbot and the chatbot responds with "I love you".
If you type in "foo" in the Textbox, open the browser console and run the following Javascript:
The Textbox now will display "bar". But if you hit ENTER, it is still "foo" that sends to the chatbot.
Screenshot
Type "foo" in Textbox, and run JS in the console change it to "bar":
Go back to Textbox and hit Enter:
It is "foo" instead of "bar" sent to the chatbot.
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: