madhushreeag commented on code in PR #41079:
URL: https://github.com/apache/superset/pull/41079#discussion_r3546932000


##########
superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx:
##########
@@ -173,12 +194,33 @@ export default function ResizableContainer({
   maxHeightMultiple = proxyToInfinity,
 }: ResizableContainerProps) {
   const [isResizing, setIsResizing] = useState<boolean>(false);
+  const [cursorLabel, setCursorLabel] = useState<{
+    x: number;
+    y: number;
+    height: number;
+  } | null>(null);
 
   const handleResize = useCallback<ResizeCallback>(
     (event, direction, elementRef, delta) => {
       if (onResize) onResize(event, direction, elementRef, delta);
+      if (direction.toLowerCase().includes(BOTTOM_RESIZE_DIRECTION)) {
+        const clientX =
+          'touches' in event
+            ? (event.touches[0]?.clientX ?? 0)
+            : (event as MouseEvent).clientX;
+        const clientY =
+          'touches' in event
+            ? (event.touches[0]?.clientY ?? 0)
+            : (event as MouseEvent).clientY;
+        const snappedDelta = Math.round(delta.height / heightStep) * 
heightStep;
+        const currentHeightPx = Math.max(
+          minHeightMultiple * heightStep,
+          heightMultiple * heightStep + snappedDelta,
+        );
+        setCursorLabel({ x: clientX, y: clientY, height: currentHeightPx });

Review Comment:
    replacing cursorLabel state with a ref and update the DOM directly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to