Skip to content

Commit 62b2f1d

Browse files
authored
Merge branch 'dev' into running-non-existent-component
2 parents 014bec7 + b13d9b8 commit 62b2f1d

File tree

5 files changed

+63
-3
lines changed

5 files changed

+63
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1111
## Fixed
1212

1313
- [#2898](https://github.com/plotly/dash/pull/2898) Fix error thrown when using non-existent components in callback running keyword. Fixes [#2897](https://github.com/plotly/dash/issues/2897).
14+
- [#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)
15+
- [#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)
1416

1517
## [2.17.1] - 2024-06-12
1618

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

+4-1
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-html-components/scripts/generate-components.js

+2-1
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 = {
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)