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
15 changes: 14 additions & 1 deletion ios/RNCPicker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import <React/RCTConvert.h>
#import <React/RCTUtils.h>

@interface RNCPicker() <UIPickerViewDataSource, UIPickerViewDelegate>
@interface RNCPicker() <UIPickerViewDataSource, UIPickerViewDelegate, UIPickerViewAccessibilityDelegate>
@end

@implementation RNCPicker
Expand Down Expand Up @@ -147,6 +147,19 @@ - (void)pickerView:(__unused UIPickerView *)pickerView
}
}

#pragma mark - UIPickerViewAccessibilityDelegate

- (NSString *)pickerView:(UIPickerView *)pickerView accessibilityLabelForComponent:(NSInteger)component
{
return self.accessibilityLabel;
}

- (NSString *)pickerView:(UIPickerView *)pickerView accessibilityHintForComponent:(NSInteger)component
{
return self.accessibilityHint;
}


#ifdef RCT_NEW_ARCH_ENABLED
- (void)pickerView:(__unused UIPickerView *)pickerView
didSelectRow:(NSInteger)row inComponent:(__unused NSInteger)component
Expand Down
4 changes: 4 additions & 0 deletions js/PickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ const PickerIOSWithForwardedRef: React.AbstractComponent<
onChange,
onValueChange,
style,
accessibilityLabel,
accessibilityHint,
} = props;

const nativePickerRef = React.useRef<React.ElementRef<
Expand Down Expand Up @@ -199,6 +201,8 @@ const PickerIOSWithForwardedRef: React.AbstractComponent<
ref={ref}
themeVariant={themeVariant}
testID={testID}
accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint}
style={[styles.pickerIOS, itemStyle]}
// $FlowFixMe
items={items}
Expand Down