Skip to content

Commit 93e4e1b

Browse files
committed
Update panelcomponent.py
1 parent 286c33b commit 93e4e1b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crystal_toolkit/core/panelcomponent.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import dash_core_components as dcc
22
import dash_html_components as html
3-
from dash.dependencies import Output, Input, State
3+
from dash.dependencies import Input, Output, State
44
from dash.exceptions import PreventUpdate
55

66
from crystal_toolkit.core.mpcomponent import MPComponent
7-
from crystal_toolkit.helpers.layouts import Reveal, PRIMARY_COLOR
7+
from crystal_toolkit.helpers.layouts import PRIMARY_COLOR, Reveal
88

99

1010
class PanelComponent(MPComponent):
@@ -42,6 +42,7 @@ def panel_layout(self, open_by_default=False):
4242
title=self.title,
4343
children=[message, description, html.Br(), initial_contents],
4444
id=self.id("panel"),
45+
summary_id=self.id("panel_summary"),
4546
open=open_by_default,
4647
)
4748

@@ -51,9 +52,11 @@ def contents_layout(self) -> html.Div:
5152
raise NotImplementedError
5253

5354
def generate_callbacks(self, app, cache):
55+
pass
56+
5457
@app.callback(
5558
Output(self.id("contents"), "children"),
56-
[Input(f"{self.id('panel')}_summary", "n_clicks")],
59+
[Input(self.id("panel_summary"), "n_clicks")],
5760
[State(self.id("contents"), "children")],
5861
)
5962
def load_panel(panel_n_clicks, current_contents):

0 commit comments

Comments
 (0)