diff --git a/CHANGELOG.md b/CHANGELOG.md index 24e7379764..b8d4a9e2c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [2.12.1] - 2023-08-16 + +## Fixed + +- [#2625](https://github.com/plotly/dash/pull/2625) Fix background callbacks without cancel arguments failing setup, fix [#2624](https://github.com/plotly/dash/issues/2624) + ## [2.12.0] - 2023-08-14 ## Fixed diff --git a/dash/dash.py b/dash/dash.py index 6e7a1d2e5d..5ffca55dbd 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -1321,8 +1321,8 @@ def _setup_server(self): long = callback.get("long") if not long: continue - cancel = long.pop("cancel_inputs") - if cancel: + if "cancel_inputs" in long: + cancel = long.pop("cancel_inputs") for c in cancel: cancels[c] = long.get("manager") diff --git a/dash/version.py b/dash/version.py index 95a6d3a792..96fc614cb2 100644 --- a/dash/version.py +++ b/dash/version.py @@ -1 +1 @@ -__version__ = "2.12.0" +__version__ = "2.12.1" diff --git a/tests/integration/long_callback/app_page_cancel.py b/tests/integration/long_callback/app_page_cancel.py index 7ea1adebf8..5134ad7a14 100644 --- a/tests/integration/long_callback/app_page_cancel.py +++ b/tests/integration/long_callback/app_page_cancel.py @@ -34,6 +34,8 @@ html.Button("cancel1", id="cancel1"), html.Div("idle", id="progress1"), html.Div("initial", id="output1"), + html.Div("no-cancel-btn", id="no-cancel-btn"), + html.Div("no-cancel", id="no-cancel-output"), ] ), ) @@ -51,6 +53,16 @@ ) +@app.callback( + Output("no-cancel-output", "children"), + Input("no-cancel-btn", "n_clicks"), + background=True, + prevent_initial_call=True, +) +def on_click_no_cancel(_): + return "Not Canceled" + + @app.callback( Output("output1", "children"), Input("start1", "n_clicks"),