mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-15 05:20:27 +02:00
feat: add container to multiple text elements (#9348)
This commit is contained in:
@@ -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));
|
const someTextElements = selectedElements.some((el) => isTextElement(el));
|
||||||
return selectedElements.length > 0 && areTextElements;
|
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);
|
||||||
|
Reference in New Issue
Block a user