Skip to content

Commit da67e20

Browse files
committed
update
1 parent 493d660 commit da67e20

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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
@@ -1,3 +1,4 @@
1+
import * as React from "react";
12
import MuiFormControl from "@mui/material/FormControl";
23
import MuiInputLabel from "@mui/material/InputLabel";
34
import MuiMenuItem from "@mui/material/MenuItem";
@@ -34,6 +35,8 @@ export function Select({
3435
multiple,
3536
onChange,
3637
}: SelectProps) {
38+
const [personName, setPersonName] = React.useState<string[]>([]);
39+
3740
const handleChange = (event: SelectChangeEvent) => {
3841
if (id) {
3942
let newValue: string | number = event.target.value;

chartlets.py/chartlets/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Component(ABC):
1919
name: str | None = None
2020
"""HTML `name` attribute. Optional."""
2121

22-
value: bool | int | float | str | None = None
22+
value: bool | int | float | str | list[bool | int | float | str] | None = None
2323
"""HTML `value` attribute. Required for specific components."""
2424

2525
style: dict[str, Any] | None = None

chartlets.py/demo/my_extension/my_panel_2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def render_panel(
2424
)
2525
select = Select(
2626
id="selected_variable_name",
27-
value=var_name,
27+
value=[var_name],
2828
label="Variable",
2929
options=[(v, v) for v in variable_names],
3030
style={"flexGrow": 0, "minWidth": 120},
31+
multiple=True,
3132
tooltip="Select the variable of the test dataset to be used",
3233
)
3334
control_group = Box(

0 commit comments

Comments
 (0)