You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Android] Bottomsheet: app crashes when there is active button in the bottomsheet and being dismissed #8038
Describe the bug
App crashes when touch event is being captured on the BottomSheet and the BottomSheet is being dismissed.
Has been reported on nativescript-material-components repo earlier: nativescript-community/ui-material-components#71
To Reproduce
To reproduce, simply capture (touch) event instead of (tap) on the component being shown on the bottomsheet and it will crash when it is dismissed.
An uncaught Exception occurred on "main" thread.
Calling js method onDismiss failed
TypeError: Cannot read property 'setOnTouchListener' of null
StackTrace:
push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onUnloaded(file:///data/data/app.name/files/app/vendor.js:102970:38)
at (file:///data/data/app.name/files/app/vendor.js:101093:92)
at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///data/data/app.name/files/app/vendor.js:101082:9)
at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callUnloaded(file:///data/data/app.name/files/app/vendor.js:101093:14)
at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.unloadView(file:///data/data/app.name/files/app/vendor.js:101222:18)
at (file:///data/data/app.name/files/app/vendor.js:101024:19)
at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///data/data/app.name/files/app/vendor.js:110064:26)
at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///data/data/app.name/files/app/vendor.js:102584:14)
changed the title [-][Android] Modal: app crashes when (touch) is captured in the modal and being dismissed[/-][+][Android] Bottomsheet: app crashes when there is active button in the bottomsheet and being dismissed[/+]on Nov 21, 2019
Activity
hamidbsd commentedon Oct 30, 2019
@farfromrefug suggested I report it here.
nativescript-community/ui-material-components#71
tsonevn commentedon Oct 31, 2019
Hi @hamidbsd,
Can you send us a sample project, where the issue, you are facing, can be reproduced?
farfromrefug commentedon Oct 31, 2019
@tsonevn i asked @hamidbsd to add it here cause i already see an issue in the code:
NativeScript/nativescript-core/ui/core/view/view.android.ts
Line 382 in cc97a16
There you don't check for
nativeViewProtected. And it might be null un unloaded.I think it is an edge case
Also should i mention that it should be done in
disposeNativeViewand notonUnloadedhamidbsd commentedon Nov 20, 2019
Here is a simple project to reproduce the crash.
I needs {N} 6.2.1 + latest Angular + [email protected]
https://www.dropbox.com/s/m1weedpegpo0rlv/Bottomsheet%20crashing.zip?dl=0
[-][Android] Modal: app crashes when (touch) is captured in the modal and being dismissed[/-][+][Android] Bottomsheet: app crashes when there is active button in the bottomsheet and being dismissed[/+]hamidbsd commentedon Nov 24, 2019
@tsonevn I did what @farfromrefug suggested and it worked!
I changed this:
NativeScript/nativescript-core/ui/core/view/view.android.ts
Lines 381 to 385 in cc97a16
to this:
And it works like a charm!