Is st.form(enter_to_submit=True)
compatible with st.text_area
?
When I have a text_area inside of such a form, the text_area says “Press [cmd]+Enter to submit form”. But when I do that, the text_area value is empty. Not sure if I am doing this wrong?
with st.form(key="my_form", enter_to_submit=True):
feedback = st.text_area("Add feedback here")
submit = st.form_submit_button("Send")
if submit:
logger.info(f"Feedback: {feedback}")
If I click the “Send” button, it works. If I press [cmd]+Enter, then the logger outputs an empty feedback
. Is this a race condition between the form submit and the text_area?
If this is expected behavior, the messaging of “Press cmd+Enter to submit form” inside of the text area is confusing and should be changed.