Skip to content

Commit 2e326fb

Browse files
committed
2.0.0 -> 2.0.1
1 parent 6bcf34e commit 2e326fb

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## 2.0.1
4+
5+
- Remove ARIA `role` attribute from `List` and `Grid`. This resulted in potentially invalid configurations (e.g. a ARIA _list_ should contain at least one _listitem_ but that was not enforced by this library). Users of this library should specify the `role` attribute that makes the most sense to them [based on mdn guidelines](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/list_role#best_practices). For example:
6+
7+
```tsx
8+
<List
9+
role="list"
10+
rowComponent={RowComponent}
11+
rowCount={names.length}
12+
rowHeight={25}
13+
rowProps={{ names }}
14+
/>;
15+
16+
function RowComponent({ index, style, ...rest }: RowComponentProps<object>) {
17+
return (
18+
<div role="listitem" style={style}>
19+
...
20+
</div>
21+
);
22+
}
23+
```
24+
325
## 2.0.0
426

527
Version 2 is a major rewrite that offers the following benefits:

lib/components/list/List.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ describe("List", () => {
297297
<List
298298
overscanCount={0}
299299
className="foo"
300+
role="list"
300301
rowCount={4}
301302
rowComponent={RowComponent}
302303
rowHeight={25}
@@ -317,6 +318,7 @@ describe("List", () => {
317318
<List
318319
overscanCount={0}
319320
data-testid="foo"
321+
role="list"
320322
rowCount={4}
321323
rowComponent={RowComponent}
322324
rowHeight={25}
@@ -333,9 +335,10 @@ describe("List", () => {
333335

334336
render(
335337
<List
336-
rowCount={4}
337338
listRef={listRef}
339+
role="list"
338340
rowComponent={RowComponent}
341+
rowCount={4}
339342
rowHeight={25}
340343
rowProps={EMPTY_OBJECT}
341344
/>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-window",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"type": "module",
55
"author": "Brian Vaughn <[email protected]> (https://github.com/bvaughn/)",
66
"contributors": [

0 commit comments

Comments
 (0)