Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

data-table: fixes warning about missing key prop #1778

Merged
merged 5 commits into from
Sep 30, 2021
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
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() == []