Skip to content

Commit 66d564e

Browse files
authored
Merge pull request #2888 from leeagustin/dcc-Loading-id-DOM
Adds id to dcc.Loading DOM
2 parents 71b1e6f + ca5d66a commit 66d564e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

components/dash-core-components/src/components/Loading.react.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const Loading = ({
2424
loading_state,
2525
display,
2626
color,
27+
id,
2728
className,
2829
style,
2930
parent_className,
@@ -144,7 +145,7 @@ const Loading = ({
144145
>
145146
{children}
146147
</div>
147-
<div style={showSpinner ? coveringSpinner : {}}>
148+
<div id={id} style={showSpinner ? coveringSpinner : {}}>
148149
{showSpinner &&
149150
(custom_spinner || (
150151
<Spinner

components/dash-core-components/tests/integration/loading/test_loading_component.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def test_ldcp001_loading_component_initialization(dash_dcc):
1010
app = Dash(__name__)
1111

1212
app.layout = html.Div(
13-
[dcc.Loading([html.Div(id="div-1")], className="loading")], id="root"
13+
[dcc.Loading([html.Div(id="div-1")], id="loading", className="loading")],
14+
id="root",
1415
)
1516

1617
@app.callback(Output("div-1", "children"), [Input("root", "n_clicks")])
@@ -20,7 +21,7 @@ def updateDiv(children):
2021

2122
with lock:
2223
dash_dcc.start_server(app)
23-
dash_dcc.find_element(".loading .dash-spinner")
24+
dash_dcc.find_element("#loading .loading .dash-spinner")
2425
# ensure inner component is also mounted
2526
dash_dcc.wait_for_text_to_equal("#div-1", "")
2627

0 commit comments

Comments
 (0)