Skip to content

Commit

Permalink
Merge branch 'dev' into running-non-existent-component
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n authored Jun 25, 2024
2 parents 014bec7 + b13d9b8 commit 62b2f1d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## Fixed

- [#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).
- [#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)
- [#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)

## [2.17.1] - 2024-06-12

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.dash-dropdown .Select-menu-outer {
z-index: 1000;
max-height: none;
}

.dash-dropdown .Select-menu, .Select-menu-outer {
.dash-dropdown .Select-menu {
max-height: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def test_ddvi001_fixed_table(dash_duo):
def test_ddvi002_maxHeight(dash_duo):
app = Dash(__name__)
app.layout = Div(
[Dropdown([str(i) for i in range(100)], "1", id="dropdown", maxHeight=800)]
[
DataTable(), # ensure datatable css does not override maxHeight #2529
Dropdown([str(i) for i in range(100)], "1", id="dropdown", maxHeight=800),
]
)

dash_duo.start_server(app)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const NUMERIC_PROPERTIES = [
'cols',
'colSpan',
'size',
'step'
'step',
'tabIndex'
];

const PROP_TYPES = {
Expand Down
53 changes: 53 additions & 0 deletions components/dash-html-components/tests/test_div_tabIndex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from dash import Dash, Input, Output, State, html


def test_dt001_div_tabindex_accept_string_and_number_type(dash_duo):
app = Dash(__name__)
app.layout = html.Div(
[
html.Div(id="string-div", tabIndex="1"),
html.Div(id="number-div", tabIndex=1),
html.Button("string", id="trigger-string"),
html.Button("number", id="trigger-number"),
html.Pre(id="output-string-result"),
html.Pre(id="output-number-result"),
],
style={"padding": 50},
)

@app.callback(
Output("output-string-result", "children"),
Input("trigger-string", "n_clicks"),
State("string-div", "tabIndex"),
prevent_initial_call=True,
)
def show_div_tabindex_string_type(n_clicks, tabindex):
if n_clicks:
if isinstance(tabindex, str):
return "success"
return "fail"

@app.callback(
Output("output-number-result", "children"),
Input("trigger-number", "n_clicks"),
State("number-div", "tabIndex"),
prevent_initial_call=True,
)
def show_div_tabindex_number_type(n_clicks, tabindex):
if n_clicks:
if isinstance(tabindex, int):
return "success"
return "fail"

dash_duo.start_server(app)

dash_duo.wait_for_element("#trigger-string").click()
dash_duo.wait_for_element("#trigger-number").click()
dash_duo.wait_for_text_to_equal(
"#output-string-result",
"success",
)
dash_duo.wait_for_text_to_equal(
"#output-number-result",
"success",
)

0 comments on commit 62b2f1d

Please sign in to comment.