Skip to content

Commit bf00422

Browse files
committed
Merge remote-tracking branch 'remote/dev' into performance-adjust
# Conflicts: # CHANGELOG.md
2 parents c409895 + 0bd4452 commit bf00422

File tree

9 files changed

+182
-101
lines changed

9 files changed

+182
-101
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).
88
- [#3113](https://github.com/plotly/dash/pull/3113) Adjusted background polling requests to strip the data from the request, this allows for context to flow as normal. This addresses issue [#3111](https://github.com/plotly/dash/pull/3111)
99
- [#3248] changes to the rendering logic
1010

11+
## Fixed
12+
- [#3251](https://github.com/plotly/dash/pull/3251). Prevented default styles from overriding `className_*` props in `dcc.Upload` component.
13+
14+
1115
## [3.0.1] - 2025-03-24
1216

1317
## Fixed

components/dash-core-components/src/fragments/Upload.react.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ export default class Upload extends Component {
6464
style_reject,
6565
style_disabled,
6666
} = this.props;
67+
68+
const activeStyle = className_active ? undefined : style_active;
69+
const disabledStyle = className_disabled ? undefined : style_disabled;
70+
const rejectStyle = className_reject ? undefined : style_reject;
71+
6772
return (
6873
<LoadingElement id={id}>
6974
<Dropzone
@@ -79,9 +84,9 @@ export default class Upload extends Component {
7984
rejectClassName={className_reject}
8085
disabledClassName={className_disabled}
8186
style={style}
82-
activeStyle={style_active}
83-
rejectStyle={style_reject}
84-
disabledStyle={style_disabled}
87+
activeStyle={activeStyle}
88+
rejectStyle={rejectStyle}
89+
disabledStyle={disabledStyle}
8590
>
8691
{children}
8792
</Dropzone>

components/dash-core-components/tests/integration/upload/test_children_accept_any_component.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,32 @@ def test_upca001_upload_children_gallery(dash_dcc):
2828
"textAlign": "center",
2929
},
3030
),
31+
dcc.Upload(
32+
"upload",
33+
disabled=True,
34+
className_disabled="upload-disabled",
35+
id="upload",
36+
),
37+
dcc.Upload("upload", disabled=True, id="upload-no-className"),
3138
]
3239
)
3340
dash_dcc.start_server(app)
3441
time.sleep(0.5)
3542
dash_dcc.percy_snapshot("upca001 children gallery")
3643

44+
first_child = dash_dcc.find_element("#upload").find_element_by_css_selector(
45+
":first-child"
46+
)
47+
# Check that there is no default style since className is specified
48+
style = first_child.get_attribute("style")
49+
assert "opacity: 0.5" not in style
50+
51+
first_child = dash_dcc.find_element(
52+
"#upload-no-className"
53+
).find_element_by_css_selector(":first-child")
54+
55+
# Check that there is default style since no className is specified
56+
style = first_child.get_attribute("style")
57+
assert "opacity: 0.5" in style
58+
3759
assert dash_dcc.get_logs() == []

dash/dash-renderer/src/components/error/CallbackGraph/CallbackGraphContainer.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
background: #ffffff;
99
display: inline-block;
1010
/* shadow-1 */
11-
box-shadow:
12-
0px 6px 16px rgba(80, 103, 132, 0.165),
11+
box-shadow: 0px 6px 16px rgba(80, 103, 132, 0.165),
1312
0px 2px 6px rgba(80, 103, 132, 0.12),
1413
0px 0px 1px rgba(80, 103, 132, 0.32);
1514
}

dash/dash-renderer/src/components/error/FrontEnd/FrontEndError.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
}
125125

126126
.dash-be-error__str {
127-
background-color: #F5F6FA;
127+
background-color: #f5f6fa;
128128
min-width: 386px;
129129
width: 100%;
130130
overflow: auto;
@@ -177,8 +177,7 @@
177177
background-color: white;
178178
overflow: auto;
179179
border-radius: 6px;
180-
box-shadow:
181-
0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
180+
box-shadow: 0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
182181
0px 1.9px 4px 0px rgba(0, 0, 0, 0.05),
183182
0px 4.5px 10px 0px rgba(0, 0, 0, 0.05);
184183
}
Lines changed: 1 addition & 0 deletions
Loading

dash/dash-renderer/src/components/error/menu/DebugMenu.css

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525
font-size: 14px;
2626
border-radius: 0px;
2727
letter-spacing: normal;
28+
white-space: nowrap;
2829
gap: 6px;
30+
cursor: pointer;
31+
border: none;
32+
background: none;
33+
outline: none;
34+
display: flex;
35+
align-items: center;
2936
}
3037

3138
.dash-debug-menu__popup {
@@ -52,8 +59,7 @@
5259
align-self: flex-end;
5360
position: relative;
5461
/* Shadow/Small */
55-
box-shadow:
56-
0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
62+
box-shadow: 0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
5763
0px 1.9px 4px 0px rgba(0, 0, 0, 0.05),
5864
0px 4.5px 10px 0px rgba(0, 0, 0, 0.05);
5965
}
@@ -113,30 +119,28 @@
113119
transition: 0.3s;
114120
box-sizing: border-box;
115121
position: fixed;
116-
bottom: 8px;
117-
right: 8px;
122+
bottom: -1px;
123+
right: -1px;
118124
display: flex;
119125
color: black;
120-
flex-direction: column;
126+
flex-direction: row;
121127
font-family: Verdana, sans-serif !important;
122128
font-size: 14px;
123-
justify-content: center;
129+
justify-content: flex-end;
124130
align-items: center;
125131
z-index: 10000;
126-
border-radius: 5px;
127-
padding: 5px;
132+
border-radius: 5px 0 0 0;
133+
padding: 15px 0;
128134
background-color: #f5f6fa;
129-
box-shadow:
130-
0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.04),
135+
box-shadow: 0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.04),
131136
0px 2.3px 2px 0px rgba(0, 0, 0, 0.03);
132137
border: 1px solid rgba(0, 24, 102, 0.1);
133138
}
134-
.dash-debug-menu__outer--closed {
135-
height: 60px;
136-
width: 60px;
137-
bottom: 37px;
138-
right: 37px;
139-
padding: 0;
139+
.dash-debug-menu__outer.dash-debug-menu__outer--collapsed {
140+
max-width: 50px;
141+
}
142+
.dash-debug-menu__outer.dash-debug-menu__outer--expanded {
143+
max-width: 682px;
140144
}
141145

142146
.dash-debug-menu__upgrade-tooltip {
@@ -153,6 +157,22 @@
153157
z-index: 1200;
154158
}
155159

160+
.dash-debug-menu__toggle {
161+
color: #7f4bc4;
162+
transition: 0.3s;
163+
}
164+
.dash-debug-menu__toggle--expanded {
165+
transform: rotate(180deg);
166+
}
167+
.dash-debug-menu__error-indicator {
168+
width: 8px;
169+
height: 8px;
170+
background-color: #DC3E42;
171+
border-radius: 100%;
172+
position: absolute;
173+
right: 3px;
174+
top: 13px;
175+
}
156176
.dash-debug-menu__status {
157177
display: flex;
158178
align-items: center;
@@ -162,7 +182,8 @@
162182
.dash-debug-menu__content {
163183
display: flex;
164184
align-items: stretch;
165-
margin: 10px;
185+
margin-left: 15px;
186+
transition: all 0.5s ease;
166187
}
167188

168189
.dash-debug-menu__version {
@@ -186,7 +207,6 @@
186207
justify-content: center;
187208
align-items: center;
188209
transition: background-color 0.2s;
189-
cursor: pointer;
190210
font-family: Verdana, sans-serif !important;
191211
font-weight: bold;
192212
color: black;
@@ -213,8 +233,7 @@
213233
right: 29px;
214234
z-index: 10002;
215235
cursor: pointer;
216-
box-shadow:
217-
0px 0px 1px rgba(0, 0, 0, 0.25),
236+
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),
218237
0px 1px 3px rgba(162, 177, 198, 0.32);
219238
border-radius: 32px;
220239
background-color: white;

0 commit comments

Comments
 (0)