Skip to content
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: 6 additions & 0 deletions .changeset/native-dataview-keyboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@wirecore/wirelayer-native': patch
---

DataView: in the browser (react-native-web) the scrolling list takes the keyboard focus, so the arrow keys scroll it even
when the items have no controls.
5 changes: 4 additions & 1 deletion packages/native/src/components/DataView/DataView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@wirecore/wirelayer-recipes/native';
import { LayoutGrid, List } from 'lucide-react-native';
import { useEffect, useRef, useState, type ReactNode } from 'react';
import { FlatList, Text, View, type StyleProp, type ViewStyle } from 'react-native';
import { FlatList, Platform, Text, View, type StyleProp, type ViewStyle } from 'react-native';
import { useLocale } from '../../locale.js';
import { useAnnouncer } from '../../utils/announce.js';
import { useControllable } from '../../utils/useControllable.js';
Expand Down Expand Up @@ -251,6 +251,9 @@ export function DataView<T>({
role="list"
aria-label={label}
aria-busy={firstLoad || (announces && busy) || undefined}
// In the browser (react-native-web) the list takes the keyboard focus, so the arrow keys scroll it even
// when the items have no controls
focusable={Platform.OS === 'web'}
contentContainerClassName={styles.content()}
onEndReached={infinite && autoLoad && !firstLoad ? onEnd : undefined}
onEndReachedThreshold={0.5}
Expand Down
Loading