-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
When including a placeholder property in a TextInput component, the accessibilityLabel and accessibilityHint properties are not read out in the screen reader. Example:
<TextInput accessible={true} accessibilityLabel={'My Accessibility Label'} accessibilityHint={'My Accessibility Hint')} accessibilityRole={'search'} style={[searchInput, { backgroundColor: searchFocus ? theme.INPUT_FOCUS_COLOR : theme.WHITE_COLOR }]} onFocus={(bool) => {set_searchFocus(bool);}} value={searchKey} inputAccessoryViewID={inputAccessoryViewID} placeholderTextColor={'#767676'} keyboardType= "default" returnKeyType={Platform.OS === 'ios' ? '' : "search"} enablesReturnKeyAutomatically={true} onSubmitEditing={() => {searchOrder();}} placeholder={formatMessageString('My Placeholder Text')} onChangeText={(searchString) =>{setSearchKey(searchString);}} underlineColorAndroid="transparent" />
One would expect the accessibilityLabel and Hint to be read out, and in my experience prior to 0.60 they were, along with the placeholder. Now, only the placeholder text his read out. Removing the placeholder property reads out the Label and Hint.
React Native version:
0.60.5
Steps To Reproduce
- Include a TextInput in project with accessibilityLabel, accessibilityHint, and placeholder text.
- Open project in device, turn on screenreader (e.g. TalkBack for Android, VoiceOver for iOS), and click the field.
- Click on field
- Note that screenreader only reads out the placeholder text, and not the accessibilityLabel and accessibilityHint.
- Remove placeholder text and reload.
- Click on field
- Note that accessbilityLabel and accessibilityHint are read out by the screenreader