From 606ac6c743ad552a484ebae0251411744b18c55c Mon Sep 17 00:00:00 2001 From: Ryan Di Date: Mon, 23 Dec 2024 05:47:21 +0800 Subject: [PATCH] fix: regression on dragging a selected frame by its name (#8924) fix hit element check for a selected frame's name --- packages/excalidraw/components/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index d5e5578ca..a201a440b 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -5085,7 +5085,11 @@ class App extends React.Component { isImageElement(element) ? 0 : this.getElementHitThreshold(), ); - return isPointInShape(pointFrom(x, y), selectionShape); + // if hitting the bounding box, return early + // but if not, we should check for other cases as well (e.g. frame name) + if (isPointInShape(pointFrom(x, y), selectionShape)) { + return true; + } } // take bound text element into consideration for hit collision as well