diff --git a/app/client/src/components/editorComponents/ResizableComponent.tsx b/app/client/src/components/editorComponents/ResizableComponent.tsx index bd5fba05ca..59168e7af9 100644 --- a/app/client/src/components/editorComponents/ResizableComponent.tsx +++ b/app/client/src/components/editorComponents/ResizableComponent.tsx @@ -3,7 +3,11 @@ import { batchUpdateMultipleWidgetProperties } from "actions/controlActions"; import { focusWidget } from "actions/widgetActions"; import { EditorContext } from "components/editorComponents/EditorContextProvider"; import type { OccupiedSpace } from "constants/CanvasEditorConstants"; -import { DefaultDimensionMap, GridDefaults } from "constants/WidgetConstants"; +import { + DefaultDimensionMap, + GridDefaults, + WidgetHeightLimits, +} from "constants/WidgetConstants"; import { get, omit } from "lodash"; import type { XYCord } from "pages/common/CanvasArenas/hooks/useRenderBlocksOnCanvas"; import React, { memo, useContext, useMemo } from "react"; @@ -71,7 +75,6 @@ export const ResizableComponent = memo(function ResizableComponent( const { updateWidget } = useContext(EditorContext); const dispatch = useDispatch(); const isAutoLayout = useSelector(getIsAutoLayout); - const Resizable = isAutoLayout ? AutoLayoutResizable : FixedLayoutResizable; const isSnipingMode = useSelector(snipingModeSelector); const isPreviewMode = useSelector(previewModeSelector); @@ -355,10 +358,21 @@ export const ResizableComponent = memo(function ResizableComponent( return !isAutoHeightEnabledForWidget(props) && isEnabled; }, [props, isAutoHeightEnabledForWidget, isEnabled]); - const fixedHeight = - isAutoHeightEnabledForWidgetWithLimits(props) || - !isAutoHeightEnabledForWidget(props) || - !props.isCanvas; + // What is the max resizable height for this widget, in pixels? + let maxHeightInPx = + WidgetHeightLimits.MAX_HEIGHT_IN_ROWS * + GridDefaults.DEFAULT_GRID_ROW_HEIGHT; // Maximum possible height + // If the widget has auto height with limits, we need to respect the set limits. + if (isAutoHeightEnabledForWidgetWithLimits(props)) { + maxHeightInPx = + (props.maxDynamicHeight || WidgetHeightLimits.MAX_HEIGHT_IN_ROWS) * + GridDefaults.DEFAULT_GRID_ROW_HEIGHT; + } + + // Is auto height enabled for widget (without limits) + const autoHeight = + isAutoHeightEnabledForWidget(props) && + !isAutoHeightEnabledForWidgetWithLimits(props); const allowResize: boolean = !isMultiSelected || (isAutoLayout && !props.isFlexChild); @@ -370,22 +384,23 @@ export const ResizableComponent = memo(function ResizableComponent( !isAppSettingsPaneWithNavigationTabOpen && !isDragging && (isHovered || isSelected); + return ( void; onStop: ( diff --git a/app/client/src/resizable/resizenreflow/index.tsx b/app/client/src/resizable/resizenreflow/index.tsx index 642dc9fdac..ae68c1db7c 100644 --- a/app/client/src/resizable/resizenreflow/index.tsx +++ b/app/client/src/resizable/resizenreflow/index.tsx @@ -1,10 +1,6 @@ import { computeRowCols } from "components/editorComponents/ResizableUtils"; import { isHandleResizeAllowed } from "components/editorComponents/ResizableUtils"; -import { - GridDefaults, - WIDGET_PADDING, - WidgetHeightLimits, -} from "constants/WidgetConstants"; +import { WIDGET_PADDING } from "constants/WidgetConstants"; import { Spring } from "react-spring"; import React, { useEffect, useMemo, useRef, useState } from "react"; import type { CSSProperties } from "react"; @@ -400,6 +396,7 @@ export function ReflowResizable(props: ResizableProps) { props.showResizeBoundary ? "show-boundary" : "" } ${pointerEvents ? "" : "pointer-event-none"}`; }, [props.className, pointerEvents, props.showResizeBoundary]); + return (