[ReactNative] expose importantForAccessibility to JS

This commit is contained in:
Dorota Kapturkiewicz 2015-08-14 03:11:05 -07:00
parent e9735556f6
commit a2c51b3b28
2 changed files with 27 additions and 0 deletions

View File

@ -100,6 +100,7 @@ var View = React.createClass({
/**
* Indicates to accessibility services to treat UI component like a
* native one. Works for Android only.
* @platform android
*/
accessibilityComponentType: PropTypes.oneOf([
'none',
@ -111,6 +112,7 @@ var View = React.createClass({
* when this view changes. Works for Android API >= 19 only.
* See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion
* for references.
* @platform android
*/
accessibilityLiveRegion: PropTypes.oneOf([
'none',
@ -118,9 +120,33 @@ var View = React.createClass({
'assertive',
]),
/**
* Controls how view is important for accessibility which is if it
* fires accessibility events and if it is reported to accessibility services
* that query the screen. Works for Android only.
* See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility
* for references.
* Possible values:
* 'auto' - The system determines whether the view is important for accessibility -
* default (recommended).
* 'yes' - The view is important for accessibility.
* 'no' - The view is not important for accessibility.
* 'no-hide-descendants' - The view is not important for accessibility,
* nor are any of its descendant views.
*
* @platform android
*/
importantForAccessibility: PropTypes.oneOf([
'auto',
'yes',
'no',
'no-hide-descendants',
]),
/**
* Provides additional traits to screen reader. By default no traits are
* provided unless specified otherwise in element
* @platform ios
*/
accessibilityTraits: PropTypes.oneOfType([
PropTypes.oneOf(AccessibilityTraits),

View File

@ -22,6 +22,7 @@ ReactNativeViewAttributes.UIView = {
accessibilityComponentType: true,
accessibilityLiveRegion: true,
accessibilityTraits: true,
importantForAccessibility: true,
testID: true,
shouldRasterizeIOS: true,
onLayout: true,