Skip to content

Make st.selectbox dropdown re-open at position of last selected option, not at the top every time #4901

@cmayoracurzio

Description

@cmayoracurzio

Problem

When using a st.selectbox widget with many options, the dropdown always reopens at the top, even if the last selected option is somewhere down in the list of options. This is only noticeable when the dropdown has a scrollbar (i.e., when there are many options).

Related yet different issue: #4671

Solution

Preferred solution: The dropdown in st.selectbox always opens up at position of last selected option.

Additional context

From the user's perspective, reopening a st.selectbox dropdown at a position that doesn't show the last selected option is confusing.


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

Views

Metadata

Metadata

Assignees

Labels

feature:st.selectboxRelated to the `st.selectbox` widgetgood first issueGood for newcomers to the codebasetype:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions