St.form_submit_button() doesn't have keyboard enter-to-submit functionality

Summary

When using st.form_submit_button() within a st.form(), there is no option to “click” the button via keyboard input. This would be useful when submitting queries using the st.text_input() method because the user would not have to rely on switching from keyboard to mouse in order to submit the form.

Steps to reproduce

Code snippet:

with st.form(key="my_form"):
      phrase = st.text_input("Write your phrase here.")
      submit_button = st.form_submit_button("Submit")

Debug info

  • Streamlit version: 1.15.1
  • Python version: 3.9
  • OS version: Windows 10

Hey @edmund-ruan,

Thanks for sharing this! Feel free to upvote/share your thoughts on the official GitHub issue for this enhancement here.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.