From ed9b8c8b3bf2cd7bab4be9f69baf695ccb066c85 Mon Sep 17 00:00:00 2001 From: Dorota Kapturkiewicz Date: Thu, 20 Aug 2015 09:11:16 -0700 Subject: [PATCH] [ReactNative] Disable accessibility of RootView when dialog appears. Apply it for AdsManager. --- Libraries/Portal/Portal.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Libraries/Portal/Portal.js b/Libraries/Portal/Portal.js index 7406fb63f44..652e9ed6f5b 100644 --- a/Libraries/Portal/Portal.js +++ b/Libraries/Portal/Portal.js @@ -90,6 +90,11 @@ var Portal = React.createClass({ }, _showModal: function(tag: string, component: any) { + // We are about to open first modal, so Portal will appear. + // Let's disable accessibility for background view on Android. + if (this._getOpenModals().length === 0) { + this.props.onModalVisibilityChanged(true); + } // This way state is chained through multiple calls to // _showModal, _closeModal correctly. this.setState((state) => { @@ -103,6 +108,11 @@ var Portal = React.createClass({ if (!this.state.modals.hasOwnProperty(tag)) { return; } + // We are about to close last modal, so Portal will disappear. + // Let's enable accessibility for application view on Android. + if (this._getOpenModals().length === 1) { + this.props.onModalVisibilityChanged(false); + } // This way state is chained through multiple calls to // _showModal, _closeModal correctly. this.setState((state) => {