From 0dc078493ad0c25f50828afa2c1b73543fe028dc Mon Sep 17 00:00:00 2001 From: Siklos Date: Mon, 1 Aug 2022 22:35:04 +0200 Subject: [PATCH] Fix reversed list --- src/Components/ElementsSidebar/ElementsSidebar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/ElementsSidebar/ElementsSidebar.tsx b/src/Components/ElementsSidebar/ElementsSidebar.tsx index b710ae3..9f8bcc9 100644 --- a/src/Components/ElementsSidebar/ElementsSidebar.tsx +++ b/src/Components/ElementsSidebar/ElementsSidebar.tsx @@ -26,7 +26,8 @@ export class ElementsSidebar extends React.Component { handleContainer(container); - container.props.children.forEach((child) => { + // if this reverse() gets costly, replace it by a simple for + container.props.children.reverse().forEach((child) => { if (visited.has(child)) { return; }