File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,11 @@ export abstract class ViewWithBottomSheetBase extends View {
73
73
this . notify ( args ) ;
74
74
}
75
75
76
+ _bottomSheetCloseIgnore = false ;
76
77
public _bottomSheetClosed ( ) : void {
78
+ if ( this . _bottomSheetCloseIgnore ) {
79
+ return ;
80
+ }
77
81
const _rootModalViews = this . _getRootModalViews ( ) ;
78
82
const modalIndex = _rootModalViews . indexOf ( this ) ;
79
83
_rootModalViews . splice ( modalIndex ) ;
@@ -108,6 +112,7 @@ export abstract class ViewWithBottomSheetBase extends View {
108
112
}
109
113
this . _raiseClosedBottomSheetEvent ( ) ;
110
114
this . _onDismissBottomSheetCallback = null ;
115
+ console . log ( '_onDismissBottomSheetCallback' , this ) ;
111
116
this . _bottomSheetClosed ( ) ;
112
117
if ( this . _bottomSheetContext . closeCallback ) {
113
118
this . _bottomSheetContext . closeCallback ( ) ;
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
75
75
this . _bottomSheetFragment = null ;
76
76
}
77
77
78
+
78
79
protected _showNativeBottomSheet ( parent : View , options : BottomSheetOptions ) {
79
80
this . _commonShowNativeBottomSheet ( parent , options ) ;
80
81
const owner = this ;
@@ -218,27 +219,17 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
218
219
} ,
219
220
220
221
onDismiss ( fragment : com . nativescript . material . bottomsheet . BottomSheetDialogFragment , dialog : android . content . DialogInterface ) : void {
221
- const manager = fragment . getFragmentManager ( ) ;
222
- if ( manager ) {
223
- bottomSheetOptions . dismissCallback ( ) ;
224
- }
225
-
226
- if ( owner && owner . isLoaded ) {
227
- owner . callUnloaded ( ) ;
222
+ if ( owner ) {
223
+ owner . _bottomSheetCloseIgnore = true ;
228
224
}
225
+ bottomSheetOptions . dismissCallback ( ) ;
229
226
} ,
230
227
231
228
onDestroy ( fragment : com . nativescript . material . bottomsheet . BottomSheetDialogFragment ) : void {
232
229
( df as any ) . nListener = null ;
233
230
if ( owner ) {
234
- // Android calls onDestroy before onDismiss.
235
- // Make sure we unload first and then call _tearDownUI.
236
- if ( owner . isLoaded ) {
237
- owner . callUnloaded ( ) ;
238
- }
239
- owner . _isAddedToNativeVisualTree = false ;
240
- owner . _tearDownUI ( true ) ;
241
- owner . parent = null ;
231
+ owner . _bottomSheetCloseIgnore = false ;
232
+ owner . _bottomSheetClosed ( ) ;
242
233
}
243
234
}
244
235
} ) ;
You can’t perform that action at this time.
0 commit comments