Skip to content

Commit

Permalink
Merge pull request #1778 from plotly/antrg-fix-datatable
Browse files Browse the repository at this point in the history
data-table: fixes warning about missing key prop
  • Loading branch information
antoinerg authored Sep 30, 2021
2 parents 8c193bc + b1fa988 commit 8a92453
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions components/dash-table/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- [#1778](https://github.com/plotly/dash/pull/1778) Fix React warnings stating
that each child in a list should have a unique "key" prop

## [4.12.0] - 2021-07-09
### Fixed
- [#907](https://github.com/plotly/dash-table/pull/907)
Expand Down
4 changes: 2 additions & 2 deletions components/dash-table/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</head>
<body>
<div id='root'></div>
<script src='https://unpkg.com/react@17.0.1/umd/react.production.min.js'></script>
<script src='https://unpkg.com/react-dom@17.0.1/umd/react-dom.production.min.js'></script>
<script src='https://unpkg.com/react@16.14.0/umd/react.development.js'></script>
<script src='https://unpkg.com/react-dom@16.14.0/umd/react-dom.development.js'></script>

<script src="./demo.js"></script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function getter(
);

return (
<div>
<div key={columnIndex}>
{!column_selectable || !selectable ? null : (
<span className='column-header--select'>
<input
Expand Down
15 changes: 15 additions & 0 deletions components/dash-table/tests/selenium/test_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,18 @@ def test_head004_change_single_row_header(test):

assert target.column("rows").get_text(0) == "Chill"
assert test.get_log_errors() == []


def test_head005_no_warnings_emitted(test):
test.start_server(
get_app(dict(merge_duplicate_headers=True)),
debug=True,
use_reloader=False,
use_debugger=True,
dev_tools_hot_reload=False,
)

target = test.table("table")

wait.until(lambda: target.column(6).get().get_attribute("colspan") == "4", 3)
assert test.get_logs() == []

0 comments on commit 8a92453

Please sign in to comment.