11import { useMemo } from 'react' ;
22import { SpectrumListViewProps } from '@adobe/react-spectrum' ;
3+ import cl from 'classnames' ;
34import { EMPTY_FUNCTION } from '@deephaven/utils' ;
45import {
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' ;
1314import { ItemElementOrPrimitive } from '../shared' ;
1415
1516export 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