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: Better accessibility role, label and hint for search results #645

Merged
merged 1 commit into from
Nov 5, 2020
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
7 changes: 6 additions & 1 deletion src/location-search/LocationResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {LocationSearchResult} from './types';
import {FavoriteIcon} from '../favorites';
import ThemeText from '../components/text';
import ThemeIcon from '../components/theme-icon';
import {screenReaderPause} from '../components/accessible-text';

type Props = {
title?: string;
Expand Down Expand Up @@ -37,7 +38,11 @@ const LocationResults: React.FC<Props> = ({
<View style={styles.locationButtonContainer}>
<TouchableOpacity
accessible={true}
accessibilityRole="menuitem"
accessibilityLabel={
searchResult.location.label + screenReaderPause
}
accessibilityHint={'Aktivér for å bruke dette resultatet.'}
accessibilityRole="button"
hitSlop={insets.symmetric(8, 1)}
onPress={() => onSelect(searchResult.selectable)}
style={styles.locationButton}
Expand Down