diff --git a/packages/core/ui/layouts/root-layout/index.android.ts b/packages/core/ui/layouts/root-layout/index.android.ts index c810e0166..eb974a606 100644 --- a/packages/core/ui/layouts/root-layout/index.android.ts +++ b/packages/core/ui/layouts/root-layout/index.android.ts @@ -10,6 +10,26 @@ export class RootLayout extends RootLayoutBase { super(); } + insertChild(view: View, atIndex: number): void { + super.insertChild(view, atIndex); + if (!view.hasGestureObservers()) { + // block tap events from going through to layers behind the view + view.nativeViewProtected.setOnTouchListener( + new android.view.View.OnTouchListener({ + onTouch: function (view, event) { + return true; + }, + }) + ); + } + } + removeChild(view: View): void { + if (view.hasGestureObservers()) { + view.nativeViewProtected.setOnTouchListener(null); + } + super.removeChild(view); + } + protected _bringToFront(view: View) { (view.nativeViewProtected).bringToFront(); }