St.multiselect does not produce list of selected elements when wrapped in a form

:rotating_light: Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked). :rotating_light:

  1. Are you running your app locally or is it deployed? Locally
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform?
    b. Share the link to the public deployed app.
  3. Share the link to your app’s public GitHub repository (including a requirements file).
  4. Share the full text of the error message (not a screenshot).
  5. Share the Streamlit and Python versions.
    Streamlit: 1.30
    Python: 3.9

I’m working on a project involving the use of a multiselect widget within a form. My intention is to provide a list of options to select, and have each selection submitted at once (appended to the list) by clicking the form’s submit button.

While the multiselect widget seems to work when selecting the elements, submitting the selections via the form_submit_button results in an empty list.

For reference, I found this post: `st.multi_select` returns empty on dynamically changing options. · Issue #7855 · streamlit/streamlit · GitHub

If I could get some assistance with this issue, or a workaround, it would be much appreciated.

If you are being hit by gh#7855, the only workaround I can think of is not using a form. Meanwhile, give a thumbs up to the bug report.