Skip to content

Commit

Permalink
Merge branch 'dev' into long-to-background
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Jul 7, 2022
2 parents ac3cb31 + a240e2d commit 499e9a2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).

## [UNRELEASED]

### Added
- [#2109](https://github.com/plotly/dash/pull/2109) Add `maxHeight` to Dropdown options menu.

### Fixed
- [#2102](https://github.com/plotly/dash/pull/2102) Fix bug as reported in [dash-labs #113](https://github.com/plotly/dash-labs/issues/113) where files starting with `.` were not excluded when building `dash.page_registry`.
- [#2098](https://github.com/plotly/dash/pull/2098) Accept HTTP code 400 as well as 401 for JWT expiry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ Dropdown.propTypes = {
*/
optionHeight: PropTypes.number,

/**
* height of the options dropdown.
*/
maxHeight: PropTypes.number,

/**
* Defines CSS styles which will override styles previously set.
*/
Expand Down Expand Up @@ -218,6 +223,7 @@ Dropdown.defaultProps = {
multi: false,
searchable: true,
optionHeight: 35,
maxHeight: 200,
persisted_props: ['value'],
persistence_type: 'local',
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.dash-dropdown .Select-menu-outer {
z-index: 1000;
}

.dash-dropdown .Select-menu, .Select-menu-outer {
max-height: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const RDProps = [
'placeholder',
'disabled',
'optionHeight',
'maxHeight',
'style',
'className',
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ def test_ddvi001_fixed_table(dash_duo):
dash_duo.percy_snapshot("dcc.Dropdown dropdown overlaps table fixed rows/columns")

assert dash_duo.get_logs() == []


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)]
)

dash_duo.start_server(app)

dash_duo.find_element("#dropdown").click()
dash_duo.wait_for_element("#dropdown .Select-menu-outer")

dash_duo.percy_snapshot("dcc.Dropdown dropdown menu maxHeight 800px")

assert dash_duo.get_logs() == []

0 comments on commit 499e9a2

Please sign in to comment.