From 629541bc9d8349f969e72dbe270db802e18607a6 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 28 Aug 2025 16:13:14 +0200 Subject: [PATCH] :bug: Fix incorrect recursion on looking boolean parent (#7212) --- .../sidebar/options/shapes/multiple.cljs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs index ae6295f6dc..29628903c7 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs @@ -277,12 +277,22 @@ [objects selected-shape-ids shape] (let [parent-id (:parent-id shape) - parent (get objects parent-id)] + parent (get objects parent-id)] + (cond - (nil? shape) false ;; failsafe - (contains? selected-shape-ids (:id shape)) false ;; if it is one of the selected shapes, it is considerer not a bool descendant - (= :bool (:type parent)) true ;; if its parent is of type bool, it is a bool descendant - :else (recur [parent-id parent] objects selected-shape-ids)))) ;; else, check its parent + (nil? shape) + false + + ;; if it is one of the selected shapes, it is considerer not a + ;; bool descendant + (contains? selected-shape-ids (:id shape)) + false + + (cfh/bool-shape? parent) + true + + :else + (recur objects selected-shape-ids parent)))) (defn- check-options-props [new-props old-props]