From c86647907ce6950b16a51f7defe2b4c0e30112a9 Mon Sep 17 00:00:00 2001 From: Christopher Tangonan <161169629+cTangonan123@users.noreply.github.com> Date: Sun, 26 Oct 2025 15:00:17 -0700 Subject: [PATCH] fix: prevent wrap text in a container to only text that are not bound to a container (#10250) * fix: only enable wrap text in a container when at least one text element selected is unbound * Trigger Rebuild --------- Co-authored-by: Mark Tolmacs --- packages/excalidraw/actions/actionBoundText.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/actions/actionBoundText.tsx b/packages/excalidraw/actions/actionBoundText.tsx index 606770dde5..383668c756 100644 --- a/packages/excalidraw/actions/actionBoundText.tsx +++ b/packages/excalidraw/actions/actionBoundText.tsx @@ -8,6 +8,7 @@ import { } from "@excalidraw/common"; import { getOriginalContainerHeightFromCache, + isBoundToContainer, resetOriginalContainerCache, updateOriginalContainerCache, } from "@excalidraw/element"; @@ -225,7 +226,9 @@ export const actionWrapTextInContainer = register({ trackEvent: { category: "element" }, predicate: (elements, appState, _, app) => { const selectedElements = app.scene.getSelectedElements(appState); - const someTextElements = selectedElements.some((el) => isTextElement(el)); + const someTextElements = selectedElements.some( + (el) => isTextElement(el) && !isBoundToContainer(el), + ); return selectedElements.length > 0 && someTextElements; }, perform: (elements, appState, _, app) => { @@ -234,7 +237,7 @@ export const actionWrapTextInContainer = register({ const containerIds: Mutable = {}; for (const textElement of selectedElements) { - if (isTextElement(textElement)) { + if (isTextElement(textElement) && !isBoundToContainer(textElement)) { const container = newElement({ type: "rectangle", backgroundColor: appState.currentItemBackgroundColor,