[ReactNative] Disable accessibility of RootView when dialog appears. Apply it for AdsManager.

This commit is contained in:
Dorota Kapturkiewicz 2015-08-20 09:11:16 -07:00
Родитель 1ca1a44a07
Коммит ed9b8c8b3b
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -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) => {