This commit is contained in:
zsviczian
2025-09-22 11:54:02 +00:00
parent f5f3b61779
commit f90bf59ecd
2 changed files with 19 additions and 17 deletions

View File

@@ -1529,10 +1529,7 @@ export const actionChangeContainerBehavior = register({
// collect directly selected eligible containers
for (const el of selected) {
if (
isFlowchartNodeElement(el) &&
getBoundTextElement(el, elementsMap)
) {
if (isFlowchartNodeElement(el) && getBoundTextElement(el, elementsMap)) {
containerIdsToUpdate.add(el.id);
}
}
@@ -1603,8 +1600,7 @@ export const actionChangeContainerBehavior = register({
// case 2: any eligible containers directly selected
targetContainers = selected.filter(
(el) =>
isFlowchartNodeElement(el) &&
getBoundTextElement(el, elementsMap),
isFlowchartNodeElement(el) && getBoundTextElement(el, elementsMap),
);
}

View File

@@ -151,11 +151,13 @@ export const SelectedShapeActions = ({
isSingleElementBoundContainer = true;
}
const textContainer = targetElements.length === 1 && isTextElement(targetElements[0])
? getContainerElement(targetElements[0], elementsMap)
: null;
const textContainer =
targetElements.length === 1 && isTextElement(targetElements[0])
? getContainerElement(targetElements[0], elementsMap)
: null;
const isStickyNoteContainer = textContainer && isFlowchartNodeElement(textContainer);
const isStickyNoteContainer =
textContainer && isFlowchartNodeElement(textContainer);
const isEditingTextOrNewElement = Boolean(
appState.editingTextElement || appState.newElement,
@@ -241,7 +243,7 @@ export const SelectedShapeActions = ({
renderAction("changeTextAlign")}
</>
)}
{shouldAllowVerticalAlign(targetElements, elementsMap) &&
renderAction("changeVerticalAlign")}
{(canHaveArrowheads(appState.activeTool.type) ||
@@ -250,7 +252,7 @@ export const SelectedShapeActions = ({
)}
{isStickyNoteContainer && <>{renderAction("changeContainerBehavior")}</>}
{renderAction("changeOpacity")}
<fieldset>
@@ -344,11 +346,13 @@ export const CompactShapeActions = ({
appState.editingTextElement || appState.newElement,
);
const textContainer = targetElements.length === 1 && isTextElement(targetElements[0])
? getContainerElement(targetElements[0], elementsMap)
: null;
const textContainer =
targetElements.length === 1 && isTextElement(targetElements[0])
? getContainerElement(targetElements[0], elementsMap)
: null;
const isStickyNoteContainer = textContainer && isFlowchartNodeElement(textContainer);
const isStickyNoteContainer =
textContainer && isFlowchartNodeElement(textContainer);
const showFillIcons =
(hasBackground(appState.activeTool.type) &&
@@ -632,7 +636,9 @@ export const CompactShapeActions = ({
renderAction("changeTextAlign")}
{shouldAllowVerticalAlign(targetElements, elementsMap) &&
renderAction("changeVerticalAlign")}
{isStickyNoteContainer && <>{renderAction("changeContainerBehavior")}</>}
{isStickyNoteContainer && (
<>{renderAction("changeContainerBehavior")}</>
)}
</div>
</PropertiesPopover>
)}