Add a note about accessibilityRole compat

This commit is contained in:
Nicolas Gallagher
2017-04-20 10:39:34 -07:00
parent 769334d04e
commit 17ed63129f
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -39,7 +39,10 @@ using `aria-label`.
In some cases, we also want to alert the end user of the type of selected In some cases, we also want to alert the end user of the type of selected
component (i.e., that it is a “button”). To provide more context to screen component (i.e., that it is a “button”). To provide more context to screen
readers, you should specify the `accessibilityRole` property. readers, you should specify the `accessibilityRole` property. (Note that React
Native for Web provides a compatibility mapping of equivalent
`accessibilityTraits` and `accessibilityComponentType` values to
`accessibilityRole`).
The `accessibilityRole` prop is used to infer an [analogous HTML The `accessibilityRole` prop is used to infer an [analogous HTML
element][html-aria-url] to use in addition to the resulting ARIA `role`, where element][html-aria-url] to use in addition to the resulting ARIA `role`, where
@@ -6,6 +6,7 @@ const accessibilityComponentTypeToRole = {
const accessibilityTraitsToRole = { const accessibilityTraitsToRole = {
adjustable: 'slider', adjustable: 'slider',
button: 'button', button: 'button',
header: 'heading',
image: 'img', image: 'img',
link: 'link', link: 'link',
none: 'presentation', none: 'presentation',