Skip to content

Commit 0a1ebb5

Browse files
committed
Pass along clearable
Note that there is an API difference between dcc.Dropdown and mpc.Select; this should be resolved to be consistent
1 parent fc488fa commit 0a1ebb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crystal_toolkit/core/mpcomponent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ def get_choice_input(
586586
label: str | None = None,
587587
help_str: str = None,
588588
options: list[dict] | None = None,
589+
clearable: bool = False,
589590
**kwargs,
590591
):
591592
"""
@@ -601,6 +602,7 @@ def get_choice_input(
601602
`state` if you want to set defaults for multiple inputs from a single dictionary.
602603
:param help_str: Text for a tooltip when hovering over label.
603604
:param options: Options to choose from, as per dcc.Dropdown
605+
:param clearable: If True, will allow Dropdown to be cleared after a selection is made.
604606
:return: a Dash layout
605607
"""
606608

@@ -611,7 +613,7 @@ def get_choice_input(
611613
id=self.id(kwarg_label, is_kwarg=True, hint="literal"),
612614
options=options if options else [],
613615
value=default,
614-
isClearable=False,
616+
isClearable=clearable,
615617
arbitraryProps={**kwargs},
616618
)
617619

0 commit comments

Comments
 (0)