Skip to content

Commit 1b35d53

Browse files
committed
fix(android): edge case fixes
1 parent cde6c9a commit 1b35d53

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/core/index.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ export function overrideViewBase() {
314314
if (!this.createStateListAnimatorTimeout) {
315315
this.createStateListAnimatorTimeout = setTimeout(() => {
316316
this.createStateListAnimatorTimeout = null;
317-
createStateListAnimator(this, this.nativeViewProtected);
317+
if (this.nativeViewProtected) {
318+
createStateListAnimator(this, this.nativeViewProtected);
319+
}
318320
});
319321
}
320322
}

src/floatingactionbutton/floatingactionbutton.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ export class FloatingActionButton extends FloatingActionButtonBase {
4242
if (!this.createStateListAnimatorTimeout) {
4343
this.createStateListAnimatorTimeout = setTimeout(() => {
4444
this.createStateListAnimatorTimeout = null;
45-
createStateListAnimator(this, this.nativeViewProtected);
45+
if(this.nativeViewProtected) {
46+
createStateListAnimator(this, this.nativeViewProtected);
47+
}
4648
});
4749
}
4850
}

src/textfield/textfield.android.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ export class TextField extends TextFieldBase {
168168
// }
169169
this.layoutView.requestFocus();
170170
setTimeout(() => {
171-
this.layoutView.setDescendantFocusability(oldDesc);
172-
Utils.android.showSoftInput(this.nativeTextViewProtected);
171+
if (this.layoutView) {
172+
this.layoutView.setDescendantFocusability(oldDesc);
173+
Utils.android.showSoftInput(this.nativeTextViewProtected);
174+
}
173175
}, 0);
174176
}
175177

src/textview/textview.android.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ export class TextView extends TextViewBase {
167167
// }
168168
layoutView.requestFocus();
169169
setTimeout(() => {
170-
layoutView.setDescendantFocusability(oldDesc);
171-
Utils.android.showSoftInput(this.nativeTextViewProtected);
170+
if (this.layoutView) {
171+
layoutView.setDescendantFocusability(oldDesc);
172+
Utils.android.showSoftInput(this.nativeTextViewProtected);
173+
}
172174
// this.focus();
173175
}, 0);
174176
}

0 commit comments

Comments
 (0)