Skip to content

Commit e9f12f3

Browse files
author
Glenn Vlekke
authored
Merge pull request #6 from MaxToyberman/master
Add accessibility support
2 parents 42ca91b + 59587b4 commit e9f12f3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ var ModalBox = createReactClass({
6565
easing: PropTypes.func,
6666
coverScreen: PropTypes.bool,
6767
keyboardTopOffset: PropTypes.number,
68-
6968
onClosed: PropTypes.func,
7069
onOpened: PropTypes.func,
7170
onClosingState: PropTypes.func,
@@ -426,7 +425,7 @@ var ModalBox = createReactClass({
426425
if (this.props.backdrop) {
427426
backdrop = (
428427
<TouchableWithoutFeedback onPress={this.props.backdropPressToClose ? this.close : null}>
429-
<Animated.View style={[styles.absolute, {opacity: this.state.backdropOpacity}]}>
428+
<Animated.View importantForAccessibility="no" style={[styles.absolute, {opacity: this.state.backdropOpacity}]}>
430429
<View style={[styles.absolute, {backgroundColor:this.props.backdropColor, opacity: this.props.backdropOpacity}]}/>
431430
{this.props.backdropContent || []}
432431
</Animated.View>
@@ -456,20 +455,21 @@ var ModalBox = createReactClass({
456455
* Render the component
457456
*/
458457
render: function() {
458+
459459
var visible = this.state.isOpen || this.state.isAnimateOpen || this.state.isAnimateClose;
460460

461461
if (!visible) return <View/>
462462

463463
var content = (
464-
<View style={[styles.transparent, styles.absolute]} pointerEvents={'box-none'}>
464+
<View importantForAccessibility="yes" accessibilityViewIsModal={true} style={[styles.transparent, styles.absolute]} pointerEvents={'box-none'}>
465465
<View style={{ flex: 1 }} pointerEvents={'box-none'} onLayout={this.onContainerLayout}>
466466
{visible && this.renderBackdrop()}
467467
{visible && this.renderContent()}
468468
</View>
469469
</View>
470470
)
471471

472-
if (!this.props.coverScreen) return content;
472+
if (!this.props.coverScreen) return content;
473473

474474
return (
475475
<Modal

0 commit comments

Comments
 (0)