Skip to content

Commit 72707ad

Browse files
authored
Merge branch 'dev' into fix/multi-set-props
2 parents 73f3266 + 2d21e62 commit 72707ad

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
66

77
## Fixed
88

9+
- [#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)
910
- [#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)
1011
- [#2859](https://github.com/plotly/dash/pull/2859) Fix base patch operators. fixes [#2855](https://github.com/plotly/dash/issues/2855)
1112
- [#2856](https://github.com/plotly/dash/pull/2856) Fix multiple consecutive calls with same id to set_props only keeping the last props. Fixes [#2852](https://github.com/plotly/dash/issues/2852)

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import DefaultSpinner from '../fragments/Loading/spinners/DefaultSpinner.jsx';
55
import CubeSpinner from '../fragments/Loading/spinners/CubeSpinner.jsx';
66
import CircleSpinner from '../fragments/Loading/spinners/CircleSpinner.jsx';
77
import DotSpinner from '../fragments/Loading/spinners/DotSpinner.jsx';
8-
import {mergeRight} from 'ramda';
98

109
const spinnerComponentOptions = {
1110
graph: GraphSpinner,
@@ -49,10 +48,6 @@ const Loading = ({
4948
justifyContent: 'center',
5049
alignItems: 'center',
5150
};
52-
const hiddenContainer = mergeRight(
53-
{visibility: 'hidden', position: 'relative'},
54-
overlay_style
55-
);
5651

5752
/* Overrides default Loading behavior if target_components is set. By default,
5853
* Loading fires when any recursive child enters loading state. This makes loading
@@ -132,14 +127,23 @@ const Loading = ({
132127

133128
return (
134129
<div
130+
style={{position: 'relative', ...parent_style}}
135131
className={parent_className}
136-
style={
137-
showSpinner
138-
? mergeRight(hiddenContainer, parent_style)
139-
: parent_style
140-
}
141132
>
142-
{children}
133+
<div
134+
className={parent_className}
135+
style={
136+
showSpinner
137+
? {
138+
visibility: 'hidden',
139+
...overlay_style,
140+
...parent_style,
141+
}
142+
: parent_style
143+
}
144+
>
145+
{children}
146+
</div>
143147
<div style={showSpinner ? coveringSpinner : {}}>
144148
{showSpinner &&
145149
(custom_spinner || (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def updateDiv(n_clicks):
406406
dash_dcc.find_element(".loading .dash-spinner")
407407
# unlike the default, the content should be visible
408408
dash_dcc.wait_for_text_to_equal("#div-1", "content")
409-
dash_dcc.wait_for_style_to_equal("#root > div", "opacity", "0.5")
409+
dash_dcc.wait_for_style_to_equal("#root > div > div", "opacity", "0.5")
410410

411411
dash_dcc.wait_for_text_to_equal("#div-1", "changed")
412412

0 commit comments

Comments
 (0)