Skip to content

Commit 2525a3d

Browse files
authored
Merge pull request #3256 from plotly/master-3.0.2
Master 3.0.2
2 parents cbbbfcb + df154ea commit 2525a3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1053
-641
lines changed

@plotly/dash-generator-test-component-typescript/dash_prop_typing.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React, { useState, useEffect } from "react";
2+
import PropTypes from "prop-types";
3+
4+
const RenderType = (props) => {
5+
const onClick = () => {
6+
props.setProps({n_clicks: (props.n_clicks || 0) + 1})
7+
}
8+
9+
return <div id={props.id}>
10+
<span>{props.dashRenderType}</span>
11+
<button onClick={onClick}>Test Internal</button>
12+
</div>;
13+
};
14+
15+
RenderType.propTypes = {
16+
id: PropTypes.string,
17+
dashRenderType: PropTypes.string,
18+
n_clicks: PropTypes.number,
19+
setProps: PropTypes.func
20+
};
21+
22+
RenderType.dashRenderType = true;
23+
export default RenderType;

@plotly/dash-test-components/src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import MyPersistedComponentNested from './components/MyPersistedComponentNested'
77
import StyledComponent from './components/StyledComponent';
88
import WidthComponent from './components/WidthComponent';
99
import ComponentAsProp from './components/ComponentAsProp';
10+
import RenderType from './components/RenderType';
1011

1112
import DrawCounter from './components/DrawCounter';
1213
import AddPropsComponent from "./components/AddPropsComponent";
@@ -32,4 +33,5 @@ export {
3233
ShapeOrExactKeepOrderComponent,
3334
ArrayOfExactOrShapeWithNodePropAssignNone,
3435
ExternalComponent,
36+
RenderType
3537
};

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [3.0.2] - 2025-04-01
6+
7+
## Changed
8+
- [#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)
9+
- [#3248](https://github.com/plotly/dash/pull/3248) Changes to rendering logic:
10+
- if it is first time rendering, render from the parent props
11+
- listens only to updates for that single component, no children listening to parents
12+
- if parents change a prop with components as props, only the prop changed re-renders, this is then forced on all children regardless of whether or not the props changed
13+
14+
## Fixed
15+
- [#3251](https://github.com/plotly/dash/pull/3251). Prevented default styles from overriding `className_*` props in `dcc.Upload` component.
16+
17+
## Added
18+
- [#3248](https://github.com/plotly/dash/pull/3248) added new `dashRenderType` to determine why the component layout was changed (`internal`, `callback`, `parent`, `clientsideApi`):
19+
- this can be utilized to keep from rendering components by the component having `dashRenderType` defined as a prop, and the `dashRenderType = true` must be set on the component, eg (`Div.dashRenderType = true`)
20+
521
## [3.0.1] - 2025-03-24
622

723
## Fixed

components/dash-core-components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/dash-core-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "3.0.3",
3+
"version": "3.0.4",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",

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.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
__version__ = "2.0.5"
3+
__version__ = "2.0.6"
44

55
_available_react_versions = {"18.3.1", "18.2.0", "16.14.0"}
66
_available_reactdom_versions = {"18.3.1", "18.2.0", "16.14.0"}
@@ -64,7 +64,7 @@ def _set_react_version(v_react, v_reactdom=None):
6464
{
6565
"relative_package_path": "dash-renderer/build/dash_renderer.min.js",
6666
"dev_package_path": "dash-renderer/build/dash_renderer.dev.js",
67-
"external_url": "https://unpkg.com/[email protected].5"
67+
"external_url": "https://unpkg.com/[email protected].6"
6868
"/build/dash_renderer.min.js",
6969
"namespace": "dash",
7070
},

dash/dash-renderer/build/dash_renderer.dev.js

Lines changed: 270 additions & 174 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)