mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Show "Wrap text in a container" context menu option, if some of selected elements are textual
This commit is contained in:
parent
c79e892e55
commit
27c8cf79ed
1 changed files with 2 additions and 2 deletions
|
@ -226,8 +226,8 @@ export const actionWrapTextInContainer = register({
|
|||
trackEvent: { category: "element" },
|
||||
predicate: (elements, appState, _, app) => {
|
||||
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) => {
|
||||
const selectedElements = app.scene.getSelectedElements(appState);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue