diff --git a/app/client/src/editorComponents/DropTargetComponent.tsx b/app/client/src/editorComponents/DropTargetComponent.tsx index b7165f2d96..baefd19c76 100644 --- a/app/client/src/editorComponents/DropTargetComponent.tsx +++ b/app/client/src/editorComponents/DropTargetComponent.tsx @@ -8,6 +8,7 @@ import WidgetFactory from "../utils/WidgetFactory"; import { widgetOperationParams, noCollision } from "../utils/WidgetPropsUtils"; import DragLayerComponent from "./DragLayerComponent"; import { WidgetFunctionsContext } from "../pages/Editor"; +import { FocusContext } from "../pages/Editor/Canvas"; type DropTargetComponentProps = ContainerProps & { updateWidget?: Function; @@ -29,6 +30,8 @@ export const DropTargetComponent = (props: DropTargetComponentProps) => { const [dropTargetOffset, setDropTargetOffset] = useState({ x: 0, y: 0 }); const { updateWidget } = useContext(WidgetFunctionsContext); const occupiedSpaces = useContext(OccupiedSpaceContext); + const { setFocus } = useContext(FocusContext); + // Make this component a drop target const [{ isOver, isExactlyOver }, drop] = useDrop({ accept: Object.values(WidgetFactory.getWidgetTypes()), @@ -87,8 +90,15 @@ export const DropTargetComponent = (props: DropTargetComponentProps) => { } }; + const handleFocus = () => { + if (props.isRoot) { + setFocus && setFocus(props.widgetId); + } + }; + return (
props.theme.spaces[1]}px; top: calc(50% - ${props => props.theme.spaces[1]}px); + z-index: 0; } &:before { left: calc(50% - ${props => props.theme.spaces[1]}px); bottom: -${props => props.theme.spaces[1]}px; + z-index: 1; } `; @@ -169,6 +176,7 @@ export const ResizableComponent = (props: ResizableComponentProps) => { resizeGrid={[props.parentColumnSpace, props.parentRowSpace]} bounds={bounds} resizeHandleStyles={handleStyles} + resizeHandleWrapperClass="top-of-stacking-context" enableResizing={{ top: true && !isDragging && isFocused === props.widgetId, right: true && !isDragging && isFocused === props.widgetId,