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

ListView: virtual keyboard navigation component #393

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions src/components/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { useMounted } from '../hooks/useMounted';
import { useKeyPress } from '../hooks';

interface ListViewProps {
onClick?: <T>(value: T) => void;
onKeyboardClick?: <T>(value: T) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onClick?: (value: any) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onKeyboardClick?: (value: any) => void;
children: React.ReactNode;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

export const Default: StoryFn = () => {
return (
<ListView>
<ListView onClick={(item) => console.log(item)} onKeyboardClick={(item) => console.log(item)}>

Check warning on line 19 in src/stories/ListView.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

Check warning on line 19 in src/stories/ListView.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
<Table width={200} gap={10}>
{data.slice(0, 5).map((item) => (
<ListViewItem
Expand Down
Loading