Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Fixed ListView props #1986

Merged
merged 1 commit into from
May 3, 2024
Merged
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
15 changes: 13 additions & 2 deletions packages/components/src/spectrum/listView/ListView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMemo } from 'react';
import { SpectrumListViewProps } from '@adobe/react-spectrum';
import cl from 'classnames';
import { EMPTY_FUNCTION } from '@deephaven/utils';
import {
ItemKey,
Expand All @@ -9,7 +10,7 @@ import {
TooltipOptions,
wrapItemChildren,
} from '../utils';
import { ListViewWrapper } from './ListViewWrapper';
import { ListViewWrapper, ListViewWrapperProps } from './ListViewWrapper';
import { ItemElementOrPrimitive } from '../shared';

export type ListViewProps = {
Expand Down Expand Up @@ -71,8 +72,18 @@ export function ListView({
<ListViewWrapper
// eslint-disable-next-line react/jsx-props-no-spreading
{...spectrumListViewProps}
UNSAFE_className="dh-list-view"
UNSAFE_className={cl('dh-list-view', UNSAFE_className)}
selectedKeys={
selectedKeys as ListViewWrapperProps<unknown>['selectedKeys']
}
Comment on lines +76 to +78
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a ticket or PR with Spectrum to include boolean in their keys? Kind of annoying we need to do this casting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a related one adobe/react-spectrum#6103 but not one for the types.

defaultSelectedKeys={
defaultSelectedKeys as ListViewWrapperProps<unknown>['defaultSelectedKeys']
}
disabledKeys={
disabledKeys as ListViewWrapperProps<unknown>['disabledKeys']
}
onScroll={onScroll}
onSelectionChange={onChange ?? onSelectionChange}
>
{wrappedItems}
</ListViewWrapper>
Expand Down
Loading