Skip to content

Commit 3673c94

Browse files
committed
fix(ios): restore pointerEvents and use valid a11y role for VoiceOver
1 parent 05784b2 commit 3673c94

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ export default class RNPickerSelect extends PureComponent {
494494
<View pointerEvents="box-only" style={containerStyle}>
495495
<TextInput
496496
testID="text_input"
497+
pointerEvents="none"
497498
style={[
498499
Platform.OS === 'ios' ? style.inputIOS : style.inputAndroid,
499500
this.getPlaceholderStyle(),
@@ -524,7 +525,8 @@ export default class RNPickerSelect extends PureComponent {
524525
activeOpacity={1}
525526
{...touchableWrapperProps}
526527
accessible
527-
accessibilityRole="combobox"
528+
// "combobox" has no effect on iOS (facebook/react-native#50123), use "button" instead
529+
accessibilityRole="button"
528530
accessibilityLabel={accessibilityLabel}
529531
accessibilityState={{ disabled, expanded: showPicker }}
530532
>

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ describe("RNPickerSelect", () => {
676676
const touchable = wrapper.find('[testID="ios_touchable_wrapper"]');
677677

678678
expect(touchable.props().accessible).toEqual(true);
679-
expect(touchable.props().accessibilityRole).toEqual("combobox");
679+
expect(touchable.props().accessibilityRole).toEqual("button");
680680
expect(touchable.props().accessibilityLabel).toEqual("Select a language");
681681
expect(touchable.props().accessibilityState).toEqual({ disabled: false, expanded: false });
682682
});

0 commit comments

Comments
 (0)