Browse Source

feat: add container to multiple text elements (#9348)

Narek Malkhasyan 4 months ago
parent
commit
6e47fadb59
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/excalidraw/actions/actionBoundText.tsx

+ 2 - 2
packages/excalidraw/actions/actionBoundText.tsx

@@ -226,8 +226,8 @@ export const actionWrapTextInContainer = register({
   trackEvent: { category: "element" },
   trackEvent: { category: "element" },
   predicate: (elements, appState, _, app) => {
   predicate: (elements, appState, _, app) => {
     const selectedElements = app.scene.getSelectedElements(appState);
     const selectedElements = app.scene.getSelectedElements(appState);
-    const areTextElements = selectedElements.every((el) => isTextElement(el));
-    return selectedElements.length > 0 && areTextElements;
+    const someTextElements = selectedElements.some((el) => isTextElement(el));
+    return selectedElements.length > 0 && someTextElements;
   },
   },
   perform: (elements, appState, _, app) => {
   perform: (elements, appState, _, app) => {
     const selectedElements = app.scene.getSelectedElements(appState);
     const selectedElements = app.scene.getSelectedElements(appState);