Skip to content

Commit

Permalink
allow setting default options
Browse files Browse the repository at this point in the history
  • Loading branch information
hoggatt committed Sep 13, 2023
1 parent fa93da4 commit c739824
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion st_combobox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def st_combobox(
clear_on_submit: bool = False,
key: str = "combobox",
rerun_on_update: bool = True,
default_options = [],
**kwargs,
) -> any:
"""
Expand All @@ -108,6 +109,8 @@ def st_combobox(
Streamlit session key. Defaults to "combobox".
rerun_on_update (bool, optional):
Rerun the search function on each keystroke. Defaults to True.
default_options (List[any], optional):
List of options to be displayed by default. Defaults to None.
Returns:
any: based on user selection
Expand All @@ -123,7 +126,7 @@ def st_combobox(
# updated after each search keystroke
"search": "",
# updated after each search_function run
"options": [],
"options": default_options,
}

# everything here is passed to react as this.props.args
Expand Down

0 comments on commit c739824

Please sign in to comment.