nativescript-community/ui-material-components

[BottomSheet][iOS] App crashes when tapping background or drag to close bottom sheet

fpaaske opened this issue · 3 comments

Which platform(s) does your issue occur on?

  • iOS 17 (emulator) iOS 16.6.1 (device, iPhone 12 mini)
  • perhaps more

And it only happens for plugin version 7.2.7 and newer.

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.6.1
{
  "name": "ns-ng-bottom-sheet-test",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "~16.2.0",
    "@angular/common": "~16.2.0",
    "@angular/compiler": "~16.2.0",
    "@angular/core": "~16.2.0",
    "@angular/forms": "~16.2.0",
    "@angular/platform-browser": "~16.2.0",
    "@angular/platform-browser-dynamic": "~16.2.0",
    "@angular/router": "~16.2.0",
    "@nativescript-community/ui-material-bottomsheet": "7.2.9",
    "@nativescript/angular": "^16.0.0",
    "@nativescript/core": "~8.6.0",
    "@nativescript/theme": "~3.0.2",
    "rxjs": "~7.8.0",
    "zone.js": "~0.13.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~16.2.0",
    "@angular/compiler-cli": "~16.2.0",
    "@nativescript/ios": "8.6.3",
    "@nativescript/preview-cli": "1.0.5",
    "@nativescript/types": "~8.6.0",
    "@nativescript/webpack": "~5.0.18",
    "@ngtools/webpack": "~16.2.0",
    "typescript": "~5.1.6"
  }
}

Please, tell us how to recreate the issue in as much detail as possible.

  • create a new project with Angular
  • add ui-material-bottom-sheet plugin
  • make item details open in bottom sheet instead of navigation
  • tap list to open bottom sheet
  • tap background to close the bottom sheet (or drag to close)
  • observe the crash
  ***** Fatal JavaScript exception - application has been terminated. *****
  NativeScript encountered a fatal error:
  Uncaught TypeError: Cannot read properties of null (reading 'nsAnimated')
   at
  	_hideNativeBottomSheet(file: src/webpack:/ns-ng-bottom-sheet-test/node_modules/@nativescript-community/ui-material-bottomsheet/bottomsheet.ios.js:385:0)
  	at _closeBottomSheetCallback(file: src/webpack:/ns-ng-bottom-sheet-test/node_modules/@nativescript-community/ui-material-bottomsheet/bottomsheet-common.js:75:0)
  	at _onDismissBottomSheetCallback(file: src/webpack:/ns-ng-bottom-sheet-test/node_modules/@nativescript-community/ui-material-bottomsheet/bottomsheet-common.js:52:0)
  	at _unloadBottomSheet(file: src/webpack:/ns-ng-bottom-sheet-test/node_modules/@nativescript-community/ui-material-bottomsheet/bottomsheet.ios.js:395:0)
  	at MDCBottomSheetControllerDelegateImpl.bottomSheetControllerDidDismissBottomSheet(file: src/webpack:/ns-ng-bottom-sheet-test/node_modules/@nativescript-community/ui-material-bottomsheet/bottomsheet.ios.js:46:0)

@fpaaske this should be fix when release this pr #452

@fpaaske @vallemar it is released

Thanks, I tested and can confirm it's fixed! Great work @vallemar @farfromrefug !