Skip to content

Commit 885c67b

Browse files
Merge branch 'plotly:dev' into windows-user-friendly-contribute
2 parents 1e5fbb8 + b13d9b8 commit 885c67b

File tree

7 files changed

+71
-6
lines changed

7 files changed

+71
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ This project adheres to [Semantic Versioning](https://semver.org/).
88

99
- [#2881](https://github.com/plotly/dash/pull/2881) Add outputs_list to window.dash_clientside.callback_context. Fixes [#2877](https://github.com/plotly/dash/issues/2877).
1010

11+
## Fixed
12+
13+
- [#2892](https://github.com/plotly/dash/pull/2860) Fix ensures dcc.Dropdown menu maxHeight option works with Datatable. Fixes [#2529](https://github.com/plotly/dash/issues/2529) [#2225](https://github.com/plotly/dash/issues/2225)
14+
- [#2896](https://github.com/plotly/dash/pull/2896) The tabIndex parameter of Div can accept number or string type. Fixes [#2891](https://github.com/plotly/dash/issues/2891)
15+
1116
## [2.17.1] - 2024-06-12
1217

1318
## Fixed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const Loading = ({
2424
loading_state,
2525
display,
2626
color,
27+
id,
2728
className,
2829
style,
2930
parent_className,
@@ -144,7 +145,7 @@ const Loading = ({
144145
>
145146
{children}
146147
</div>
147-
<div style={showSpinner ? coveringSpinner : {}}>
148+
<div id={id} style={showSpinner ? coveringSpinner : {}}>
148149
{showSpinner &&
149150
(custom_spinner || (
150151
<Spinner
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.dash-dropdown .Select-menu-outer {
22
z-index: 1000;
3+
max-height: none;
34
}
45

5-
.dash-dropdown .Select-menu, .Select-menu-outer {
6+
.dash-dropdown .Select-menu {
67
max-height: none;
78
}

components/dash-core-components/tests/integration/dropdown/test_visibility.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ def test_ddvi001_fixed_table(dash_duo):
5050
def test_ddvi002_maxHeight(dash_duo):
5151
app = Dash(__name__)
5252
app.layout = Div(
53-
[Dropdown([str(i) for i in range(100)], "1", id="dropdown", maxHeight=800)]
53+
[
54+
DataTable(), # ensure datatable css does not override maxHeight #2529
55+
Dropdown([str(i) for i in range(100)], "1", id="dropdown", maxHeight=800),
56+
]
5457
)
5558

5659
dash_duo.start_server(app)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def test_ldcp001_loading_component_initialization(dash_dcc):
1010
app = Dash(__name__)
1111

1212
app.layout = html.Div(
13-
[dcc.Loading([html.Div(id="div-1")], className="loading")], id="root"
13+
[dcc.Loading([html.Div(id="div-1")], id="loading", className="loading")],
14+
id="root",
1415
)
1516

1617
@app.callback(Output("div-1", "children"), [Input("root", "n_clicks")])
@@ -20,7 +21,7 @@ def updateDiv(children):
2021

2122
with lock:
2223
dash_dcc.start_server(app)
23-
dash_dcc.find_element(".loading .dash-spinner")
24+
dash_dcc.find_element("#loading .loading .dash-spinner")
2425
# ensure inner component is also mounted
2526
dash_dcc.wait_for_text_to_equal("#div-1", "")
2627

components/dash-html-components/scripts/generate-components.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const NUMERIC_PROPERTIES = [
5656
'cols',
5757
'colSpan',
5858
'size',
59-
'step'
59+
'step',
60+
'tabIndex'
6061
];
6162

6263
const PROP_TYPES = {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
from dash import Dash, Input, Output, State, html
2+
3+
4+
def test_dt001_div_tabindex_accept_string_and_number_type(dash_duo):
5+
app = Dash(__name__)
6+
app.layout = html.Div(
7+
[
8+
html.Div(id="string-div", tabIndex="1"),
9+
html.Div(id="number-div", tabIndex=1),
10+
html.Button("string", id="trigger-string"),
11+
html.Button("number", id="trigger-number"),
12+
html.Pre(id="output-string-result"),
13+
html.Pre(id="output-number-result"),
14+
],
15+
style={"padding": 50},
16+
)
17+
18+
@app.callback(
19+
Output("output-string-result", "children"),
20+
Input("trigger-string", "n_clicks"),
21+
State("string-div", "tabIndex"),
22+
prevent_initial_call=True,
23+
)
24+
def show_div_tabindex_string_type(n_clicks, tabindex):
25+
if n_clicks:
26+
if isinstance(tabindex, str):
27+
return "success"
28+
return "fail"
29+
30+
@app.callback(
31+
Output("output-number-result", "children"),
32+
Input("trigger-number", "n_clicks"),
33+
State("number-div", "tabIndex"),
34+
prevent_initial_call=True,
35+
)
36+
def show_div_tabindex_number_type(n_clicks, tabindex):
37+
if n_clicks:
38+
if isinstance(tabindex, int):
39+
return "success"
40+
return "fail"
41+
42+
dash_duo.start_server(app)
43+
44+
dash_duo.wait_for_element("#trigger-string").click()
45+
dash_duo.wait_for_element("#trigger-number").click()
46+
dash_duo.wait_for_text_to_equal(
47+
"#output-string-result",
48+
"success",
49+
)
50+
dash_duo.wait_for_text_to_equal(
51+
"#output-number-result",
52+
"success",
53+
)

0 commit comments

Comments
 (0)