Skip to content

Commit 5ce115c

Browse files
committed
Merge branch 'dev' into update-deps-3.0.4
2 parents ff0be31 + 23528a1 commit 5ce115c

File tree

8 files changed

+73
-6
lines changed

8 files changed

+73
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1010
- [#3284](https://github.com/plotly/dash/pull/3284) Fix component as props having the same key when used in the same container.
1111
- [#3287](https://github.com/plotly/dash/pull/3287) Fix typing component generation & explicitize_args.
1212
- [#3282](https://github.com/plotly/dash/pull/3282) Fix incorrect cancellation of pattern matched long callbacks.
13+
- [#3289](https://github.com/plotly/dash/pull/3289) Fixed issue with debugTitle where status doesnt exist and allow_duplicates to ignore the hash for prop loading in the target.
1314

1415
## [3.0.3] - 2025-04-14
1516

components/dash-core-components/src/fragments/Loading/spinners/CircleSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const CircleSpinner = ({
1616
style,
1717
}) => {
1818
let debugTitle;
19-
if (debug) {
19+
if (debug && status) {
2020
debugTitle = status.map((s) => <DebugTitle {...s} />);
2121
}
2222
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/CubeSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import DebugTitle from './DebugTitle.jsx';
77

88
const CubeSpinner = ({status, color, fullscreen, debug, className, style}) => {
99
let debugTitle;
10-
if (debug) {
10+
if (debug && status) {
1111
debugTitle = status.map((s) => <DebugTitle {...s} />);
1212
}
1313
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/DefaultSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const DefaultSpinner = ({
1515
style,
1616
}) => {
1717
let debugTitle;
18-
if (debug) {
18+
if (debug && status) {
1919
debugTitle = status.map((s) => <DebugTitle {...s} />);
2020
}
2121
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/DotSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import DebugTitle from './DebugTitle.jsx';
88
*/
99
const DotSpinner = ({status, color, fullscreen, debug, className, style}) => {
1010
let debugTitle;
11-
if (debug) {
11+
if (debug && status) {
1212
debugTitle = status.map((s) => <DebugTitle {...s} />);
1313
}
1414
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/GraphSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import DebugTitle from './DebugTitle.jsx';
55

66
const GraphSpinner = ({status, fullscreen, debug, className, style}) => {
77
let debugTitle;
8-
if (debug) {
8+
if (debug && status) {
99
debugTitle = status.map((s) => <DebugTitle {...s} />);
1010
}
1111
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,69 @@ def updateDiv(n_clicks):
689689
dash_dcc.wait_for_text_to_equal("#div-1", "changed")
690690

691691
assert dash_dcc.get_logs() == []
692+
693+
694+
# multiple components, only one triggers the spinner
695+
def test_ldcp017_loading_component_target_components_duplicates(dash_dcc):
696+
697+
lock = Lock()
698+
699+
app = Dash(__name__)
700+
701+
app.layout = html.Div(
702+
[
703+
dcc.Loading(
704+
[
705+
html.Button(id="btn-1"),
706+
html.Button(id="btn-2", children="content 2"),
707+
],
708+
className="loading-1",
709+
target_components={"btn-2": "children"},
710+
debug=True,
711+
)
712+
],
713+
id="root",
714+
)
715+
716+
@app.callback(Output("btn-1", "children"), [Input("btn-2", "n_clicks")])
717+
def updateDiv1(n_clicks):
718+
if n_clicks:
719+
with lock:
720+
return "changed 1"
721+
722+
return "content 1"
723+
724+
@app.callback(
725+
Output("btn-2", "children", allow_duplicate=True),
726+
[Input("btn-1", "n_clicks")],
727+
prevent_initial_call=True,
728+
)
729+
def updateDiv2(n_clicks):
730+
if n_clicks:
731+
with lock:
732+
return "changed 2"
733+
734+
return "content 2"
735+
736+
dash_dcc.start_server(app)
737+
738+
dash_dcc.wait_for_text_to_equal("#btn-1", "content 1")
739+
dash_dcc.wait_for_text_to_equal("#btn-2", "content 2")
740+
741+
with lock:
742+
dash_dcc.find_element("#btn-1").click()
743+
744+
dash_dcc.find_element(".loading-1 .dash-spinner")
745+
dash_dcc.wait_for_text_to_equal("#btn-2", "")
746+
747+
dash_dcc.wait_for_text_to_equal("#btn-2", "changed 2")
748+
749+
with lock:
750+
dash_dcc.find_element("#btn-2").click()
751+
spinners = dash_dcc.find_elements(".loading-1 .dash-spinner")
752+
dash_dcc.wait_for_text_to_equal("#btn-1", "")
753+
754+
dash_dcc.wait_for_text_to_equal("#btn-1", "changed 1")
755+
assert spinners == []
756+
757+
assert dash_dcc.get_logs() == []

dash/dash-renderer/src/actions/callbacks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ export function executeCallback(
748748
const __execute = async (): Promise<CallbackResult> => {
749749
const loadingOutputs = outputs.map(out => ({
750750
path: getPath(paths, out.id),
751-
property: out.property,
751+
property: out.property?.split('@')[0],
752752
id: out.id
753753
}));
754754
dispatch(loading(loadingOutputs));

0 commit comments

Comments
 (0)