ljmotta commented on code in PR #2254:
URL:
https://github.com/apache/incubator-kie-tools/pull/2254#discussion_r1578213897
##########
packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx:
##########
@@ -63,6 +68,12 @@ export function ShapeOptions({
const boundPositionX = useMemo(() => +(shapeBound?.["@_x"]?.toFixed(2) ??
""), [shapeBound]);
const boundPositionY = useMemo(() => +(shapeBound?.["@_y"]?.toFixed(2) ??
""), [shapeBound]);
+ // this variable was introduced because of scenarios, when user switches
between nodes without closing and reopening the properties panel
+ const [currentlyReShapedNodeId, setCurrentlyReShapedNodeId] =
useState<string>(nodeIds[0]);
Review Comment:
I guess I understand the reason behind this. The way to solve this, is to
have the `nodes` outside of the `onBlur` callback. It would look like the
`shape` constant.
```ts
const node= useDmnEditorStore((s) =>
s.computed(s).getDiagramData(externalModelsByNamespace).nodesById.get(nodeIds[0])
);
```
This way `node` will be updated everytime the `nodeIds` are updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]