From d4b494f301e11a8b36e0cc2b6a67f6b900129f07 Mon Sep 17 00:00:00 2001 From: Pierre-Charles David Date: Wed, 19 Jun 2024 17:07:44 +0200 Subject: [PATCH] [3645] Revert earlier change in selection propagation which caused regressions Bug: https://github.com/eclipse-sirius/sirius-web/issues/3645 Signed-off-by: Pierre-Charles David --- CHANGELOG.adoc | 1 + .../src/selection/SelectionContext.tsx | 16 +--------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index d7af0253a7..77af219a77 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -110,6 +110,7 @@ image:doc/screenshots/insideLabelPositions.png[Inside label positions, 70%] - https://github.com/eclipse-sirius/sirius-web/issues/3653[#3653] [gantt] Add documentation for gantt representation - https://github.com/eclipse-sirius/sirius-web/issues/3634[#3634] [sirius-web] Simplifying the contribution to the GraphQL subscription of the diagram for custom nodes - https://github.com/eclipse-sirius/sirius-web/issues/3656[#3656] [core] Add the ability to customize the GraphQL type resolver +- https://github.com/eclipse-sirius/sirius-web/issues/3645[#3645] [core] Revert earlier change made in #3595 which caused regressions == v2024.5.0 diff --git a/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx b/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx index ca665fdd1e..39b7c9929a 100644 --- a/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx +++ b/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx @@ -32,21 +32,7 @@ export const SelectionContextProvider = ({ initialSelection, children }: Selecti }); const setSelection = useCallback((selection: Selection) => { - setState((prevState) => { - const prevSelectionKey = prevState.selection.entries - .map((entry) => entry.id) - .sort() - .join(':'); - const newSelectionKey = selection.entries - .map((entry) => entry.id) - .sort() - .join(':'); - if (prevSelectionKey !== newSelectionKey) { - return { ...prevState, selection }; - } else { - return prevState; - } - }); + setState((prevState) => ({ ...prevState, selection })); }, []); return (