Skip to content

Commit c3d6919

Browse files
committed
fix validation in multiselect
1 parent 34249da commit c3d6919

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mercury/widgets/multiselect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ class MultiSelect:
8383
def __init__(
8484
self, value=[], choices=[], label="MultiSelect", url_key="", disabled=False, hidden=False
8585
):
86-
if not value and len(choices) > 1:
86+
if value is None:
87+
value = [choices[0]]
88+
if len(value) == 0 and len(choices) > 1:
8789
value = [choices[0]]
8890

8991
self.code_uid = WidgetsManager.get_code_uid("MultiSelect", key=url_key)

0 commit comments

Comments
 (0)