From 0d449f129276af00d4ee07868497c76d6a128683 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 23 Mar 2022 13:26:03 +0100 Subject: [PATCH] :bug: Fix constraints assignation on multi-selection --- CHANGES.md | 1 + .../main/ui/workspace/sidebar/options/menus/constraints.cljs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2ac9df048..c6ef612cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ ### :sparkles: New features +- Constraints are not well assigned when default and multiselection [Taiga #3069](https://tree.taiga.io/project/penpot/issue/3069) - Exporting big files flow [Taiga #2218](https://tree.taiga.io/project/penpot/us/2218) - Multiexport from main menu [Taiga #520](https://tree.taiga.io/project/penpot/us/28541) - Multipexport assets (aka bulk export) [Taiga #520](https://tree.taiga.io/project/penpot/us/520) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/constraints.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/constraints.cljs index 6a83b194b..6616503ab 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/constraints.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/constraints.cljs @@ -45,12 +45,13 @@ in-frame? (and (some? ids) (not= (:parent-id values) uuid/zero)) + ;; TODO: uncomment when fixed-scroll is fully implemented ;; first-level? (and in-frame? ;; (= (:parent-id values) (:frame-id values))) - constraints-h (get values :constraints-h (gsh/default-constraints-h values)) - constraints-v (get values :constraints-v (gsh/default-constraints-v values)) + constraints-h (or (get values :constraints-h) (gsh/default-constraints-h values)) + constraints-v (or (get values :constraints-v) (gsh/default-constraints-v values)) on-constraint-button-clicked (mf/use-callback