diff --git a/src/components/App.tsx b/src/components/App.tsx index e430026c..8cf5f522 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -2224,12 +2224,13 @@ class App extends React.Component { existingTextElement = selectedElements[0]; } else if (isTextBindableContainer(selectedElements[0], false)) { existingTextElement = getBoundTextElement(selectedElements[0]); + } else { + existingTextElement = this.getTextElementAtPosition(sceneX, sceneY); } + } else { + existingTextElement = this.getTextElementAtPosition(sceneX, sceneY); } - existingTextElement = - existingTextElement ?? this.getTextElementAtPosition(sceneX, sceneY); - // bind to container when shouldBind is true or // clicked on center of container if ( diff --git a/src/element/textWysiwyg.test.tsx b/src/element/textWysiwyg.test.tsx index ae7f1341..de7528be 100644 --- a/src/element/textWysiwyg.test.tsx +++ b/src/element/textWysiwyg.test.tsx @@ -115,6 +115,9 @@ describe("textWysiwyg", () => { height: textSize, containerId: container.id, }); + mutateElement(container, { + boundElements: [{ type: "text", id: text.id }], + }); h.elements = [container, text];