Skip to content

Instantly share code, notes, and snippets.

@trinadhkoya
Created November 29, 2024 17:09
Show Gist options
  • Save trinadhkoya/d8fc121a73309c4a470d6f3aebfeb6ae to your computer and use it in GitHub Desktop.
Save trinadhkoya/d8fc121a73309c4a470d6f3aebfeb6ae to your computer and use it in GitHub Desktop.
import React from 'react';
import { View, Text, FlatList } from 'react-native';
const App = () => {
const items = [
{ id: '1', title: 'Item 1', description: 'Description 1', price: '$10' },
{ id: '2', title: 'Item 2', description: 'Description 2', price: '$20' },
{ id: '3', title: 'Item 3', description: 'Description 3', price: '$30' }
];
const renderItem = ({ item }) => (
<View style={{ padding: 16, marginRight: 16, borderWidth: 1, width: 250, height: 150 }}>
<Text style={{ fontWeight: 'bold' }}>{item.title}</Text>
<Text style={{ marginTop: 8 }}>{item.description}</Text>
<Text style={{ marginTop: 8, fontWeight: '600' }}>{item.price}</Text>
</View>
);
return (
<FlatList
data={items}
renderItem={renderItem}
keyExtractor={item => item.id}
horizontal={true}
showsHorizontalScrollIndicator={true}
/>
);
};
export default App;
@trinadhkoya
Copy link
Author

Steps Tried to Resolve:

Added accessible={true} to the parent View of each item and combined content into a single accessibilityLabel.
Result: VoiceOver reads the combined label but doesn’t fix the reading order when accessible is removed.
Experimented with accessibilityViewIsModal, accessibilityRole, and accessibilityLabel on child elements.
Result: The reading order issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment