How to paste multiple values into a multiselect

Hello!

I’m trying to copy-paste multiple values into a multiselect, but it doesn’t work.

I might take the longer route and add a text input that get splitted into a list and then used as default, but this smells a lot from a UX perspective.

import streamlit as st

values = ["a", "b", "c", "d", "e"]

for sep in [",", " ", "|", "\n"]:
    st.code(sep.join(values))

selected = st.multiselect("Select many", values)

st.success(selected)

Thanks

1 Like

I don’t think there is a great way to do that currently, but feel free to create a feature request on Issues · streamlit/streamlit · GitHub, or add a :+1: if you find an existing issue asking for this feature (I didn’t see one with a quick search).

1 Like

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