Skip to content

Commit

Permalink
prevent value and options from sharing the same reference (fixes #3014)
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed May 6, 2024
1 parent dc18f72 commit 6e78db5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nicegui/elements/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def __init__(self,
value = []
elif not isinstance(value, list):
value = [value]
else:
value = value[:] # NOTE: avoid modifying the original list which could be the list of options (#3014)
super().__init__(options=options, value=value, on_change=on_change, validation=validation)
if label is not None:
self._props['label'] = label
Expand Down

0 comments on commit 6e78db5

Please sign in to comment.