diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed4634415..4b2fdee740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - [#3646](https://github.com/plotly/dash/pull/3646) Remove React 16 support (`16.14.0` is no longer an accepted value for `REACT_VERSION` / `_set_react_version`). ### Changed +- [#4015](https://github.com/plotly/dash/pull/4015) Replace the `circle` spinner in `dcc.Loading` with a rotating ring, ported from react-spinners. Apps using `type="circle"` will see the new spinner. - [#4026](https://github.com/plotly/dash/pull/4026) Log a warning, once per process, when a streaming request is refused because its stream token failed verification, which on multi-worker deployments usually means the workers do not share a signing secret. - [#3987](https://github.com/plotly/dash/pull/3987) Forward FastAPI reload scope options (`reload_dirs`, `reload_excludes`, and `reload_includes`) to Uvicorn when reloading. - [#3986](https://github.com/plotly/dash/pull/3986) Adjust `_run_before_hooks` in the `fastapi` backend to honor a response returned by a `before_request` function, matching the `flask` backend's behavior. diff --git a/components/dash-core-components/src/fragments/Loading/spinners/CircleSpinner.tsx b/components/dash-core-components/src/fragments/Loading/spinners/CircleSpinner.tsx index 36d3320910..5007df564c 100644 --- a/components/dash-core-components/src/fragments/Loading/spinners/CircleSpinner.tsx +++ b/components/dash-core-components/src/fragments/Loading/spinners/CircleSpinner.tsx @@ -3,7 +3,7 @@ import DebugTitle from './DebugTitle'; import {SpinnerProps} from '../types'; /** - * Spinner created by Tobias Ahlin, https://github.com/tobiasahlin/SpinKit + * Spinner created by David Hu, https://github.com/davidhu2000/react-spinners */ const CircleSpinner = ({ status, @@ -24,20 +24,7 @@ const CircleSpinner = ({ return (
{debugTitle} -
-
-
-
-
-
-
-
-
-
-
-
-
-
+
); diff --git a/components/dash-core-components/tests/integration/loading/test_loading_component.py b/components/dash-core-components/tests/integration/loading/test_loading_component.py index dd7946e7e8..7fe1f94e3a 100644 --- a/components/dash-core-components/tests/integration/loading/test_loading_component.py +++ b/components/dash-core-components/tests/integration/loading/test_loading_component.py @@ -886,3 +886,28 @@ def updateDiv(n_clicks): dash_dcc.wait_for_text_to_equal(".div-1", "changed") assert dash_dcc.get_logs() == [] + + +def test_ldcp020_loading_component_circle_spinner(dash_dcc): + app = Dash(__name__) + + app.layout = html.Div( + dcc.Loading( + html.Div("content"), + type="circle", + color="rgb(255, 0, 0)", + display="show", + className="loading", + ) + ) + + dash_dcc.start_server(app) + + spinner = ".loading .dash-spinner.dash-circle-spinner" + dash_dcc.wait_for_style_to_equal(spinner, "border-top-color", "rgba(255, 0, 0, 1)") + dash_dcc.wait_for_style_to_equal(spinner, "border-bottom-color", "rgba(0, 0, 0, 0)") + dash_dcc.wait_for_style_to_equal( + spinner, "animation-name", "dash-circle-spinner-rotate" + ) + + assert dash_dcc.get_logs() == [] diff --git a/tests/integration/renderer/test_loading_states.py b/tests/integration/renderer/test_loading_states.py index 9818902f61..8b295ebf00 100644 --- a/tests/integration/renderer/test_loading_states.py +++ b/tests/integration/renderer/test_loading_states.py @@ -50,7 +50,7 @@ def input_triggers_nested(value): def wait_for_all_spinners(): dash_duo.find_element(".loading-1 .dash-spinner.dash-default-spinner") - dash_duo.find_element(".loading-2 .dash-spinner.dash-sk-circle") + dash_duo.find_element(".loading-2 .dash-spinner.dash-circle-spinner") dash_duo.find_element(".loading-3 .dash-spinner.dash-cube-container") def wait_for_no_spinners():