Skip to content

Commit 8a92453

Browse files
authored
Merge pull request #1778 from plotly/antrg-fix-datatable
data-table: fixes warning about missing key prop
2 parents 8c193bc + b1fa988 commit 8a92453

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

components/dash-table/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [Unreleased]
6+
### Fixed
7+
- [#1778](https://github.com/plotly/dash/pull/1778) Fix React warnings stating
8+
that each child in a list should have a unique "key" prop
9+
510
## [4.12.0] - 2021-07-09
611
### Fixed
712
- [#907](https://github.com/plotly/dash-table/pull/907)

components/dash-table/demo/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</head>
66
<body>
77
<div id='root'></div>
8-
<script src='https://unpkg.com/react@17.0.1/umd/react.production.min.js'></script>
9-
<script src='https://unpkg.com/react-dom@17.0.1/umd/react-dom.production.min.js'></script>
8+
<script src='https://unpkg.com/react@16.14.0/umd/react.development.js'></script>
9+
<script src='https://unpkg.com/react-dom@16.14.0/umd/react-dom.development.js'></script>
1010

1111
<script src="./demo.js"></script>
1212
</body>

components/dash-table/src/dash-table/derived/header/content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function getter(
283283
);
284284

285285
return (
286-
<div>
286+
<div key={columnIndex}>
287287
{!column_selectable || !selectable ? null : (
288288
<span className='column-header--select'>
289289
<input

components/dash-table/tests/selenium/test_header.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,18 @@ def test_head004_change_single_row_header(test):
127127

128128
assert target.column("rows").get_text(0) == "Chill"
129129
assert test.get_log_errors() == []
130+
131+
132+
def test_head005_no_warnings_emitted(test):
133+
test.start_server(
134+
get_app(dict(merge_duplicate_headers=True)),
135+
debug=True,
136+
use_reloader=False,
137+
use_debugger=True,
138+
dev_tools_hot_reload=False,
139+
)
140+
141+
target = test.table("table")
142+
143+
wait.until(lambda: target.column(6).get().get_attribute("colspan") == "4", 3)
144+
assert test.get_logs() == []

0 commit comments

Comments
 (0)