@@ -561,6 +561,14 @@ export type Props = $ReadOnly<{|
561561 ...IOSProps ,
562562 ...AndroidProps ,
563563
564+ /**
565+ * String to be read by screenreaders to indicate an error state. The acceptable parameters
566+ * of accessibilityErrorMessage is a string. Setting accessibilityInvalid to true activates
567+ * the error message. Setting accessibilityInvalid to false removes the error message.
568+ */
569+ accessibilityErrorMessage ?: ?Stringish ,
570+ accessibilityInvalid ?: ?boolean ,
571+
564572 /**
565573 * Can tell `TextInput` to automatically capitalize certain characters.
566574 *
@@ -1365,6 +1373,12 @@ function InternalTextInput(props: Props): React.Node {
13651373 }
13661374
13671375 const accessible = props . accessible !== false ;
1376+
1377+ const accessibilityErrorMessage =
1378+ props . accessibilityInvalid === true
1379+ ? props . accessibilityErrorMessage
1380+ : null ;
1381+
13681382 const focusable = props . focusable !== false ;
13691383
13701384 const config = React . useMemo (
@@ -1439,6 +1453,7 @@ function InternalTextInput(props: Props): React.Node {
14391453 ref = { ref }
14401454 { ...otherProps }
14411455 { ...eventHandlers }
1456+ accessibilityErrorMessage = { accessibilityErrorMessage }
14421457 accessibilityState = { _accessibilityState }
14431458 accessible = { accessible }
14441459 submitBehavior = { submitBehavior }
@@ -1490,6 +1505,7 @@ function InternalTextInput(props: Props): React.Node {
14901505 ref = { ref }
14911506 { ...otherProps }
14921507 { ...eventHandlers }
1508+ accessibilityErrorMessage = { accessibilityErrorMessage }
14931509 accessibilityState = { _accessibilityState }
14941510 accessibilityLabelledBy = { _accessibilityLabelledBy }
14951511 accessible = { accessible }
0 commit comments