Skip to content

Commit d522fee

Browse files
committed
Added label property to Dropdown
1 parent 6c437d8 commit d522fee

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

dashipy/dashipy/components/dropdown.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55

66
@dataclass(frozen=True)
77
class Dropdown(Component):
8+
label: str | None = None
89
options: list[tuple[str, str | int | float]] = field(default_factory=list)

dashipy/my_extension/my_panel_1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ def render_panel(ctx: Context) -> Component:
1919
dropdown = Dropdown(
2020
id="selected_dataset",
2121
value=selected_dataset,
22+
label="Dataset",
2223
options=[(f"DS #{i + 1}", i) for i in range(len(ctx.datasets))],
23-
style={"flexGrow": 0},
24+
style={"flexGrow": 0, "minWidth": 120},
2425
)
2526
control_group = Box(
2627
style={

dashipy/my_extension/my_panel_2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ def render_panel(ctx: Context) -> Component:
1919
dropdown = Dropdown(
2020
id="selected_dataset",
2121
value=selected_dataset,
22+
label="Dataset",
2223
options=[(f"DS #{i + 1}", i) for i in range(len(ctx.datasets))],
23-
style={"flexGrow": 0},
24+
style={"flexGrow": 0, "minWidth": 120},
2425
)
2526
control_group = Box(
2627
style={

0 commit comments

Comments
 (0)