Skip to content

Commit fdcb865

Browse files
cjhopmanFacebook Github Bot 8
authored andcommitted
Fix sending accessibility events to RN modals
Reviewed By: dmmiller Differential Revision: D3472359 fbshipit-source-id: c82d8e254cdd0531eb52805a6f00e63cf783fdc8
1 parent 4ec53ee commit fdcb865

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.view.View;
2222
import android.view.ViewGroup;
2323
import android.view.WindowManager;
24+
import android.view.accessibility.AccessibilityEvent;
2425

2526
import com.facebook.infer.annotation.Assertions;
2627
import com.facebook.react.R;
@@ -109,6 +110,13 @@ public void addChildrenForAccessibility(ArrayList<View> outChildren) {
109110
// Those will be handled by the mHostView which lives in the dialog
110111
}
111112

113+
@Override
114+
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
115+
// Explicitly override this to prevent accessibility events being passed down to children
116+
// Those will be handled by the mHostView which lives in the dialog
117+
return false;
118+
}
119+
112120
public void onDropInstance() {
113121
((ReactContext) getContext()).removeLifecycleEventListener(this);
114122
dismiss();

0 commit comments

Comments
 (0)