Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- [#722](https://github.com/plotly/dash-table/pull/722) Fix a bug where row height is misaligned when using fixed_columns and/or fixed_rows
- [#728](https://github.com/plotly/dash-table/pull/728) Fix copy/paste on readonly cells
- [#724](https://github.com/plotly/dash-table/pull/724) Fix `active_cell` docstring: clarify optional nature of the `row_id` nested prop
- [#732](https://github.com/plotly/dash-table/pull/732) Fix a bug where opening a dropdown scrolled the table down its last row
- [#731](https://github.com/plotly/dash-table/pull/731) Fix a bug where `data=None` and `columns=None` caused the table to throw an error

## [4.6.2] - 2020-04-01
Expand Down
1 change: 1 addition & 0 deletions src/dash-table/components/CellDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class CellDropdown extends PureComponent<IProps> {
onChange={(newValue: any) => {
onChange(newValue ? newValue.value : newValue);
}}
scrollMenuIntoView={false}
onOpen={this.handleOpenDropdown}
options={dropdown}
placeholder={''}
Expand Down
5 changes: 5 additions & 0 deletions tests/selenium/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ def is_focused(self):

return "focused" in cell.get_attribute("class").split(" ")

def open_dropdown(self):
cell = self.get()

cell.find_element_by_css_selector(".Select-arrow").click()


class DataTableColumnFacade(object):
@preconditions(_validate_id, _validate_mixin, _validate_col_id, _validate_state)
Expand Down
51 changes: 51 additions & 0 deletions tests/selenium/test_dropdown.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import dash

from dash_table import DataTable


def get_app():
app = dash.Dash(__name__)

columns = [
dict(id="a", name="a"),
dict(id="b", name="b"),
dict(id="c", name="c", presentation="dropdown"),
]

app.layout = DataTable(
id="table",
columns=columns,
dropdown=dict(
c=dict(
options=[
dict(label="Value-0", value=0),
dict(label="Value-1", value=1),
dict(label="Value-2", value=2),
dict(label="Value-3", value=3),
]
)
),
data=[dict(a=i, b=i, c=i % 4) for i in range(100)],
editable=True,
)

return app


def get_page_offset(test):
return test.driver.execute_script(
"return document.body.getBoundingClientRect().top;"
)


def test_drpd001_no_scroll(test):
test.start_server(get_app())

target = test.table("table")
cell = target.cell(1, "c")

yOffset = get_page_offset(test)

cell.open_dropdown()

assert get_page_offset(test) == yOffset