From b71e70299152b61091a15dc7005315d3a2701524 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Tue, 4 Jan 2022 18:02:16 +0530 Subject: [PATCH] fix: undo should work when selecting bounded textr (#4537) --- src/element/textElement.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/element/textElement.ts b/src/element/textElement.ts index d1f598ed..96fe125c 100644 --- a/src/element/textElement.ts +++ b/src/element/textElement.ts @@ -11,7 +11,6 @@ import { BOUND_TEXT_PADDING } from "../constants"; import { MaybeTransformHandleType } from "./transformHandles"; import Scene from "../scene/Scene"; import { AppState } from "../types"; -import { isTextElement } from "."; export const redrawTextBoundingBox = ( element: ExcalidrawTextElement, @@ -21,10 +20,9 @@ export const redrawTextBoundingBox = ( const maxWidth = container ? container.width - BOUND_TEXT_PADDING * 2 : undefined; - let text = element.originalText; - // Call wrapText only when updating text properties - // By clicking on the container - if (container && !isTextElement(appState.editingElement)) { + let text = element.text; + + if (container) { text = wrapText( element.originalText, getFontString(element),