Skip to content

Commit 6592fc9

Browse files
committed
fix(bottomsheet): ios regression fix for trackingScrollView
1 parent 373a527 commit 6592fc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bottomsheet/bottomsheet.ios.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class MDCBottomSheetControllerDelegateImpl extends NSObject {
3838
//normalized = (value - min) / (max - min);
3939
let normalized = 0;
4040
if (yOffset + bottomPadding > heightScreen - heightCollapsedSheet) {
41-
normalized = ((heightScreen - yOffset - bottomPadding) - 0) / (heightCollapsedSheet - 0) - 1;
41+
normalized = (heightScreen - yOffset - bottomPadding - 0) / (heightCollapsedSheet - 0) - 1;
4242
} else {
43-
normalized = ((heightScreen - yOffset) - heightCollapsedSheet) / (heightScreen - heightCollapsedSheet);
43+
normalized = (heightScreen - yOffset - heightCollapsedSheet) / (heightScreen - heightCollapsedSheet);
4444
}
4545
owner._onChangeStateBottomSheetCallback(StateBottomSheet.DRAGGING, normalized);
4646
} else {
@@ -71,7 +71,7 @@ class MDCBottomSheetControllerDelegateImpl extends NSObject {
7171
}
7272
} else {
7373
if (owner && owner._onChangeStateBottomSheetCallback) {
74-
owner._onChangeStateBottomSheetCallback(state === MDCSheetState.Extended ? StateBottomSheet.EXPANDED : StateBottomSheet.EXPANDED)
74+
owner._onChangeStateBottomSheetCallback(state === MDCSheetState.Extended ? StateBottomSheet.EXPANDED : StateBottomSheet.EXPANDED);
7575
}
7676
}
7777
}
@@ -443,7 +443,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
443443
if (options.trackingScrollView) {
444444
const scrollView = this.getViewById(options.trackingScrollView);
445445
if (scrollView && scrollView.nativeViewProtected instanceof UIScrollView) {
446-
(bottomSheet.presentationController as MDCBottomSheetPresentationController).trackingScrollView = scrollView.nativeViewProtected;
446+
bottomSheet.trackingScrollView = scrollView.nativeViewProtected;
447447
}
448448
}
449449
controller.nsAnimated = true;
@@ -499,4 +499,4 @@ export function install() {
499499
mixinInstalled = true;
500500
overrideBottomSheet();
501501
}
502-
}
502+
}

0 commit comments

Comments
 (0)