Fix sending accessibility events to RN modals

Reviewed By: dmmiller

Differential Revision: D3472359

fbshipit-source-id: c82d8e254cdd0531eb52805a6f00e63cf783fdc8
This commit is contained in:
Chris Hopman 2016-06-22 16:41:19 -07:00 committed by Facebook Github Bot 8
parent 4ec53ee8fa
commit fdcb865cf3
1 changed files with 8 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.R;
@ -109,6 +110,13 @@ public class ReactModalHostView extends ViewGroup implements LifecycleEventListe
// Those will be handled by the mHostView which lives in the dialog
}
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
// Explicitly override this to prevent accessibility events being passed down to children
// Those will be handled by the mHostView which lives in the dialog
return false;
}
public void onDropInstance() {
((ReactContext) getContext()).removeLifecycleEventListener(this);
dismiss();