From 8998a33e49bf35a12f4c22bf0681ea9476f5aeea Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Tue, 14 May 2024 09:09:59 -0700 Subject: [PATCH 1/5] Fix dcc.Loading spinner style --- .../src/components/Loading.react.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/components/dash-core-components/src/components/Loading.react.js b/components/dash-core-components/src/components/Loading.react.js index 71538254c1..57ffab05b9 100644 --- a/components/dash-core-components/src/components/Loading.react.js +++ b/components/dash-core-components/src/components/Loading.react.js @@ -5,7 +5,6 @@ import DefaultSpinner from '../fragments/Loading/spinners/DefaultSpinner.jsx'; import CubeSpinner from '../fragments/Loading/spinners/CubeSpinner.jsx'; import CircleSpinner from '../fragments/Loading/spinners/CircleSpinner.jsx'; import DotSpinner from '../fragments/Loading/spinners/DotSpinner.jsx'; -import {mergeRight} from 'ramda'; const spinnerComponentOptions = { graph: GraphSpinner, @@ -49,10 +48,6 @@ const Loading = ({ justifyContent: 'center', alignItems: 'center', }; - const hiddenContainer = mergeRight( - {visibility: 'hidden', position: 'relative'}, - overlay_style - ); /* Overrides default Loading behavior if target_components is set. By default, * Loading fires when any recursive child enters loading state. This makes loading @@ -135,11 +130,17 @@ const Loading = ({ className={parent_className} style={ showSpinner - ? mergeRight(hiddenContainer, parent_style) + ? {position: 'relative', ...parent_style} : parent_style } > - {children} +
+ {children} +
{showSpinner && (custom_spinner || ( From ba27733e6ecedbaf600e6d91051234ecb00e1234 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 15 May 2024 10:03:31 -0700 Subject: [PATCH 2/5] fix tests --- .../src/components/Loading.react.js | 15 +++++++++------ .../integration/loading/test_loading_component.py | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/components/dash-core-components/src/components/Loading.react.js b/components/dash-core-components/src/components/Loading.react.js index 57ffab05b9..58bad22d77 100644 --- a/components/dash-core-components/src/components/Loading.react.js +++ b/components/dash-core-components/src/components/Loading.react.js @@ -127,16 +127,19 @@ const Loading = ({ return (
{children} 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 e511f01308..def38a98f8 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 @@ -406,7 +406,7 @@ def updateDiv(n_clicks): dash_dcc.find_element(".loading .dash-spinner") # unlike the default, the content should be visible dash_dcc.wait_for_text_to_equal("#div-1", "content") - dash_dcc.wait_for_style_to_equal("#root > div", "opacity", "0.5") + dash_dcc.wait_for_style_to_equal("#root > div > div", "opacity", "0.5") dash_dcc.wait_for_text_to_equal("#div-1", "changed") From bfe5b6af0ba24c03043bc930ff97b49b55c9e116 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 15 May 2024 10:07:29 -0700 Subject: [PATCH 3/5] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afb766f810..abe28d7bef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Fixed + +- [#2860](https://github.com/plotly/dash/pull/2860) Fix dcc.Loading to apply overlay_style only to the children and not the spinner. [#2858](https://github.com/plotly/dash/issues/2858) - [#2854](https://github.com/plotly/dash/pull/2854) Fix dcc.Dropdown resetting empty values to null and triggering callbacks. Fixes [#2850](https://github.com/plotly/dash/issues/2850) - [#2859](https://github.com/plotly/dash/pull/2859) Fix base patch operators. fixes [#2855](https://github.com/plotly/dash/issues/2855) From eef2673a3dc823565af4b973c62740440ce99876 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 15 May 2024 10:29:31 -0700 Subject: [PATCH 4/5] rerun tests --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abe28d7bef..c338c26d29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Fixed -- [#2860](https://github.com/plotly/dash/pull/2860) Fix dcc.Loading to apply overlay_style only to the children and not the spinner. [#2858](https://github.com/plotly/dash/issues/2858) +- [#2860](https://github.com/plotly/dash/pull/2860) Fix dcc.Loading to apply overlay_style only to the children and not the spinner. Fixes [#2858](https://github.com/plotly/dash/issues/2858) - [#2854](https://github.com/plotly/dash/pull/2854) Fix dcc.Dropdown resetting empty values to null and triggering callbacks. Fixes [#2850](https://github.com/plotly/dash/issues/2850) - [#2859](https://github.com/plotly/dash/pull/2859) Fix base patch operators. fixes [#2855](https://github.com/plotly/dash/issues/2855) From 42b330542530a4a0a70f540197997a185776ff69 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 15 May 2024 10:49:46 -0700 Subject: [PATCH 5/5] rerun tests --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c338c26d29..005a40dbac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,6 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Fixed - - [#2860](https://github.com/plotly/dash/pull/2860) Fix dcc.Loading to apply overlay_style only to the children and not the spinner. Fixes [#2858](https://github.com/plotly/dash/issues/2858) - [#2854](https://github.com/plotly/dash/pull/2854) Fix dcc.Dropdown resetting empty values to null and triggering callbacks. Fixes [#2850](https://github.com/plotly/dash/issues/2850) - [#2859](https://github.com/plotly/dash/pull/2859) Fix base patch operators. fixes [#2855](https://github.com/plotly/dash/issues/2855)