fix: default view to clickable so touches dont get “passed through”

This commit is contained in:
Martin Guillon
2020-11-23 11:14:41 +01:00
parent c92a88fce7
commit 8aa2ef867c

View File

@@ -465,7 +465,10 @@ export class View extends ViewCommon {
public initNativeView(): void {
super.initNativeView();
this._isClickable = this.nativeViewProtected.isClickable();
if (this.nativeViewProtected.setClickable) {
this.nativeViewProtected.setClickable(this.isUserInteractionEnabled);
}
if (this.hasListeners(ViewCommon.layoutChangedEvent)) {
this.setOnLayoutChangeListener();
}
@@ -492,10 +495,6 @@ export class View extends ViewCommon {
this.nativeViewProtected.setOnTouchListener(this.touchListener);
this.touchListenerIsSet = true;
if (this.nativeViewProtected.setClickable) {
this.nativeViewProtected.setClickable(this.isUserInteractionEnabled);
}
}
private setOnLayoutChangeListener() {