diff --git a/CHANGES.md b/CHANGES.md index 3a4da21ef..1b7a66aab 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ ## Next ### New features + ### Bugs fixed @@ -18,6 +19,7 @@ - Improve component testing - Increase default deletion delay to 7 days - Show a pixel grid when zoom greater than 800% [#519](https://github.com/penpot/penpot/discussions/519) +- Fix behavior of select all command when there are objects outside frames [Taiga #1209](https://tree.taiga.io/project/penpot/issue/1209) ### Bugs fixed diff --git a/common/app/common/pages/helpers.cljc b/common/app/common/pages/helpers.cljc index 778968bf6..ca025949f 100644 --- a/common/app/common/pages/helpers.cljc +++ b/common/app/common/pages/helpers.cljc @@ -224,7 +224,9 @@ (defn select-toplevel-shapes ([objects] (select-toplevel-shapes objects nil)) - ([objects {:keys [include-frames?] :or {include-frames? false}}] + ([objects {:keys [include-frames? include-frame-children?] + :or {include-frames? false + include-frame-children? true}}] (let [lookup #(get objects %) root (lookup uuid/zero) root-children (:shapes root) @@ -241,7 +243,7 @@ (or (not= :frame typ) include-frames?) (d/concat [obj]) - (= :frame typ) + (and (= :frame typ) include-frame-children?) (d/concat (map lookup children))))))] (reduce lookup-shapes [] root-children)))) diff --git a/frontend/src/app/main/data/workspace/selection.cljs b/frontend/src/app/main/data/workspace/selection.cljs index a1f994a7d..11d982eb6 100644 --- a/frontend/src/app/main/data/workspace/selection.cljs +++ b/frontend/src/app/main/data/workspace/selection.cljs @@ -164,11 +164,10 @@ (not= (:id common-frame-id) uuid/zero)) (-> (get objects common-frame-id) :shapes) - (let [frames (cp/select-frames objects)] - (->> (if (seq frames) - frames - (cp/select-toplevel-shapes objects)) - (map :id))))) + (->> (cp/select-toplevel-shapes objects + {:include-frames? true + :include-frame-children? false}) + (map :id)))) is-not-blocked (fn [shape-id] (not (get-in state [:workspace-data :pages-index page-id