Skip to content

Commit

Permalink
fix: allowed content max height be applied for dynamic sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Sep 17, 2023
1 parent 9564467 commit af53c28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1180,17 +1180,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
[_providedStyle, containerAnimatedStyle]
);
const contentContainerAnimatedStyle = useAnimatedStyle(() => {
/**
* if dynamic sizing is enabled, and content height
* is still not set, then we exit method.
*/
if (
enableDynamicSizing &&
animatedContentHeight.value === INITIAL_CONTAINER_HEIGHT
) {
return {};
}

/**
* if content height was provided, then we skip setting
* calculated height.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function createBottomSheetScrollableComponent<T, P>(
animatedFooterHeight,
animatedScrollableState,
animatedContentHeight,
enableDynamicSizing,
} = useBottomSheetInternal();
//#endregion

Expand All @@ -83,7 +84,9 @@ export function createBottomSheetScrollableComponent<T, P>(
//#region callbacks
const handleContentSizeChange = useStableCallback(
(contentWidth: number, contentHeight: number) => {
animatedContentHeight.value = contentHeight;
if (enableDynamicSizing) {
animatedContentHeight.value = contentHeight;
}

if (onContentSizeChange) {
onContentSizeChange(contentWidth, contentHeight);
Expand Down

0 comments on commit af53c28

Please sign in to comment.