Kusuma04-dev commented on code in PR #3720:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3720#discussion_r3913119916


##########
packages/xyflow-react-kie-diagram/src/diagram/XyFlowReactKieDiagram.tsx:
##########
@@ -527,8 +562,11 @@ export function XyFlowReactKieDiagram<
                     state.xyFlowReactKieDiagram.newNodeProjection!;
 
                   let foundContainer = false;
-                  for (const potentialContainer of 
reactFlowInstance?.getNodes().reverse() ??
-                    [] /* Respect the nodes z-index */) {
+                  // Use xyFlowStoreApi for synchronous access; nodeLookup 
stores InternalNode<Node> so we cast
+                  // through unknown to Node<NData, N> (safe since NData 
satisfies Record<string, unknown>).
+                  for (const potentialContainer of (
+                    Array.from(xyFlowStoreApi.getState().nodeLookup.values()) 
as unknown as RF.Node<NData, N>[]

Review Comment:
   I haven't pushed the changes yet for this @ljmotta , i am fixing in local 
and running e2e tests locally. I will update once all changes are done. Please 
hold review.



-- 
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]

Reply via email to