Skip to content

Commit

Permalink
fix(ui): fix calculation of aria-setsize
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejay97 committed Oct 24, 2022
1 parent 6453660 commit 864290d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/ui/src/components/virtual-scroll/VirtualScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,17 @@ function VirtualScroll<T>(props: DVirtualScrollProps<T>, ref: React.ForwardedRef
const getList = (arr: (T | typeof EMPTY)[], parent: T[] = []): React.ReactNode[] => {
const fillSize = [0, 0];
const list: React.ReactNode[] = [];
const setsize = arr.filter((item) => item !== EMPTY && (dItemNested?.(item)?.inAriaSetsize ?? true)).length;
const setsize = arr.filter((item) => {
if (item === EMPTY) {
return false;
} else {
const nestedData = dItemNested?.(item);
if (nestedData && nestedData.list) {
return nestedData.inAriaSetsize;
}
}
return true;
}).length;

for (const [index, item] of arr.entries()) {
let key: DId = '';
Expand Down

0 comments on commit 864290d

Please sign in to comment.