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

[Documentation] Adding accessibilityErrorMessage prop to TextInput #3010

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 15 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
23 changes: 23 additions & 0 deletions docs/textinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,29 @@ Inherits [View Props](view.md#props).

---

### `accessibilityErrorMessage`

String read by screenreaders to indicate an error state of a TextInput.
Setting accessibilityInvalid to true activates the error message.
Copy link
Contributor

@lunaleaps lunaleaps Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also reference the web specification about this? Or that this follows the web spec? Or does that make things more unclear since it's not exactly following aria-errormessage? See my comment here: facebook/react-native#33468 (comment)

Copy link
Contributor

@lunaleaps lunaleaps Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
String read by screenreaders to indicate an error state of a TextInput.
Setting accessibilityInvalid to true activates the error message.
String read by screenreaders to indicate an error state of a TextInput.
Setting accessibilityInvalid to true activates the error message.
Note: This prop models [`aria-errormessage`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage#description) but differs in that it does not provide an element id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


| Type |
| ------ |
| string |

---

### `accessibilityInvalid`

Setting accessibilityInvalid to true activates the accessibilityErrorMessage.
Setting accessibilityInvalid to false removes the accessibilityErrorMessage.
The default value is `false`.

| Type |
| ---- |
| bool |

---

### `allowFontScaling`

Specifies whether fonts should scale to respect Text Size accessibility settings. The default is `true`.
Expand Down