Skip to content

Commit 2ffa9be

Browse files
committed
add multiple to select component
1 parent a43be77 commit 2ffa9be

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

chartlets.js/packages/lib/src/plugins/mui/Select.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export type SelectOption =
1616

1717
interface SelectState extends ComponentState {
1818
options?: SelectOption[];
19+
multiple?: boolean
1920
}
2021

2122
interface SelectProps extends ComponentProps, SelectState {}
@@ -30,6 +31,7 @@ export function Select({
3031
style,
3132
tooltip,
3233
label,
34+
multiple,
3335
onChange,
3436
}: SelectProps) {
3537
const handleChange = (event: SelectChangeEvent) => {
@@ -56,6 +58,7 @@ export function Select({
5658
name={name}
5759
value={`${value}`}
5860
disabled={disabled}
61+
multiple={multiple}
5962
onChange={handleChange}
6063
>
6164
{Array.isArray(options) &&

chartlets.py/chartlets/components/select.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class Select(Component):
1313
"""Select components are used for collecting user provided
1414
information from a list of options."""
1515

16+
multiple: bool | None = None
17+
"""Allows for multiple selection in Select Menu. If `true` value
18+
must be an array.
19+
"""
20+
1621
options: list[SelectOption] = field(default_factory=list)
1722
"""The options given as a list of number or text values or a list
1823
of (value, label) pairs.

0 commit comments

Comments
 (0)