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

View File

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