pc.form inputs don't clear until all on_submit functions complete #1202
Unanswered
simonmesmith
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
there is a good example of how to solve for this in the tutorial. But effectively you need to create a state variable that maps to your input form, and in the button event handler, clear that variable by setting it to an empty string. That will then clear your input box. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm really happy we can now submit with the "enter" key, but have a small issue. I'm hoping that I'm just implementing this incorrectly.
I'm creating a chat with an LLM backend.
My form looks like this:
My State class looks like this:
When a user submits the form, the expected behavior is that it clears the input fields, then calls the LLM.
Instead, the inputs still contain the contents the user submitted until the add_assistant_message() function has completed.
Ideally, I'd love to:
Not sure what's possible.
Again, maybe I'm implementing this incorrectly.
Beta Was this translation helpful? Give feedback.
All reactions