diff --git a/common/src/app/common/types/shape/layout.cljc b/common/src/app/common/types/shape/layout.cljc index 43e446978..5a48aa016 100644 --- a/common/src/app/common/types/shape/layout.cljc +++ b/common/src/app/common/types/shape/layout.cljc @@ -1111,7 +1111,6 @@ (defn assign-cell-positions [parent objects] - (prn ">>>>assign-cell-positions" (:name parent)) (-> parent (check-deassigned-cells objects) (reassign-positions) @@ -1128,7 +1127,6 @@ ;; - (maybe) create group/frames. This case will assigna a cell that had one of its children (defn assign-cells [parent objects] - (prn ">assign-cells") (let [parent (assign-cell-positions parent objects) shape-has-cell? diff --git a/frontend/src/app/main/ui/workspace/viewport/grid_layout_editor.cljs b/frontend/src/app/main/ui/workspace/viewport/grid_layout_editor.cljs index 0e95f631f..52f4cf8b3 100644 --- a/frontend/src/app/main/ui/workspace/viewport/grid_layout_editor.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/grid_layout_editor.cljs @@ -341,11 +341,17 @@ handle-context-menu (mf/use-callback + (mf/deps (:id shape) (:id cell) selected?) (fn [event] (dom/prevent-default event) (dom/stop-propagation event) (let [position (dom/get-client-position event)] - (st/emit! (dw/show-grid-cell-context-menu {:position position :grid-id (:id shape)})))))] + (if selected? + (st/emit! (dw/show-grid-cell-context-menu {:position position :grid-id (:id shape)})) + + ;; If right-click on a non-selected cell we select the cell and then open the menu + (st/emit! (dwge/set-selection (:id shape) (:id cell)) + (dw/show-grid-cell-context-menu {:position position :grid-id (:id shape)}))))))] [:g.cell-editor ;; DEBUG OVERLAY