Skip to content

Commit c240541

Browse files
committed
fix: (iOS) fix trackingScrollView and peekHeight
1 parent d58622e commit c240541

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bottomsheet/bottomsheet-common.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface BottomSheetOptions {
3131
ignoreBottomSafeArea?: boolean; // optional ios parameter to bottom safe area. Default is false
3232
disableDimBackground?: boolean; // optional parameter to remove the dim background
3333
skipCollapsedState?: boolean; // optional Android parameter to skip midway state when view is greater than 50%. Default is false
34-
peekHeight?: number; // optional Android parameter to set the collapsed sheet height.
34+
peekHeight?: number; // optional parameter to set the collapsed sheet height. To work on iOS you need to set trackingScrollView.
3535
ignoreKeyboardHeight: boolean; //(iOS only) A Boolean value that controls whether the height of the keyboard should affect the bottom sheet's frame when the keyboard shows on the screen. (Default: true)
3636
}
3737

src/bottomsheet/bottomsheet.ios.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
415415
if (options.trackingScrollView) {
416416
const scrollView = this.getViewById(options.trackingScrollView);
417417
if (scrollView && scrollView.nativeViewProtected instanceof UIScrollView) {
418-
bottomSheet.trackingScrollView = scrollView.nativeViewProtected;
418+
(bottomSheet.presentationController as MDCBottomSheetPresentationController).trackingScrollView = scrollView.nativeViewProtected;
419419
}
420420
}
421421
controller.nsAnimated = true;

0 commit comments

Comments
 (0)