Hi again (starting to feel like a local here! got too many annoying questions ),
Just wondering why pressing the enter/return key in a Streamlit form doesn’t automatically submit the form. I’ve done some tests and pressing enter on a text_input in a form doesn’t seem to trigger a re-run of the script so it seems it’s not being used for that.
Could it be that it’s because the
<form> tags are omitted in the rendered html?
It would be epic if the input widget that currently has focus is seen as part of that specific form and the corresponding submit button so that it’s possible to have multiple forms too that won’t get in the way with the enter key press since it will just grab the submit button that’s part of that form where the focus is at.
There’s a good case to be made for accessibility too!
(The Enter Key should Submit Forms, Stop Suppressing it)
Thanks and have an awesome Streamlitty-bitty day!