From 588e1356e30e26c0ba4e5f190560c2ddb2b53d2b Mon Sep 17 00:00:00 2001 From: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com> Date: Thu, 24 Feb 2022 13:54:37 +0100 Subject: [PATCH] fix: scrolling issue in container and modals for app view --- app/client/src/widgets/CanvasWidget.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/client/src/widgets/CanvasWidget.tsx b/app/client/src/widgets/CanvasWidget.tsx index 767bb7c445..6a2b7e905f 100644 --- a/app/client/src/widgets/CanvasWidget.tsx +++ b/app/client/src/widgets/CanvasWidget.tsx @@ -3,7 +3,9 @@ import { WidgetProps } from "widgets/BaseWidget"; import ContainerWidget, { ContainerWidgetProps, } from "widgets/ContainerWidget/widget"; +import { GridDefaults } from "constants/WidgetConstants"; import DropTargetComponent from "components/editorComponents/DropTargetComponent"; +import { getCanvasSnapRows } from "utils/WidgetPropsUtils"; import { getCanvasClassName } from "utils/generators"; import WidgetFactory, { DerivedPropertiesMap } from "utils/WidgetFactory"; @@ -57,9 +59,16 @@ class CanvasWidget extends ContainerWidget { } getPageView() { + let height = 0; + const snapRows = getCanvasSnapRows( + this.props.bottomRow, + this.props.canExtend, + ); + height = snapRows * GridDefaults.DEFAULT_GRID_ROW_HEIGHT; + const style: CSSProperties = { width: "100%", - height: "100%", + height: `${height}px`, background: "none", position: "relative", };