🐛 Fix problem with create board on cells

This commit is contained in:
alonso.torres 2024-01-09 15:41:54 +01:00 committed by Andrey Antukh
parent c7ed642f6a
commit 5c3ea37bbe
2 changed files with 7 additions and 3 deletions

View file

@ -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