Skip to content

Commit 9aa0a35

Browse files
committed
Fixed ListView props (#1985)
1 parent a283e13 commit 9aa0a35

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

packages/components/src/spectrum/listView/ListView.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useMemo } from 'react';
22
import { SpectrumListViewProps } from '@adobe/react-spectrum';
3+
import cl from 'classnames';
34
import { EMPTY_FUNCTION } from '@deephaven/utils';
45
import {
56
ItemKey,
@@ -9,7 +10,7 @@ import {
910
TooltipOptions,
1011
wrapItemChildren,
1112
} from '../utils';
12-
import { ListViewWrapper } from './ListViewWrapper';
13+
import { ListViewWrapper, ListViewWrapperProps } from './ListViewWrapper';
1314
import { ItemElementOrPrimitive } from '../shared';
1415

1516
export type ListViewProps = {
@@ -53,8 +54,8 @@ export function ListView({
5354
disabledKeys,
5455
UNSAFE_className,
5556
onChange,
56-
onScroll = EMPTY_FUNCTION,
5757
onSelectionChange,
58+
onScroll = EMPTY_FUNCTION,
5859
...spectrumListViewProps
5960
}: ListViewProps): JSX.Element | null {
6061
const tooltipOptions = useMemo(
@@ -71,8 +72,18 @@ export function ListView({
7172
<ListViewWrapper
7273
// eslint-disable-next-line react/jsx-props-no-spreading
7374
{...spectrumListViewProps}
74-
UNSAFE_className="dh-list-view"
75+
UNSAFE_className={cl('dh-list-view', UNSAFE_className)}
76+
selectedKeys={
77+
selectedKeys as ListViewWrapperProps<unknown>['selectedKeys']
78+
}
79+
defaultSelectedKeys={
80+
defaultSelectedKeys as ListViewWrapperProps<unknown>['defaultSelectedKeys']
81+
}
82+
disabledKeys={
83+
disabledKeys as ListViewWrapperProps<unknown>['disabledKeys']
84+
}
7585
onScroll={onScroll}
86+
onSelectionChange={onChange ?? onSelectionChange}
7687
>
7788
{wrappedItems}
7889
</ListViewWrapper>

0 commit comments

Comments
 (0)