From 2cd8b65a5ced7065c596f908a56252207264b83d Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Thu, 3 Nov 2022 07:37:02 +0100 Subject: [PATCH] :bug: Fix colorpicker does not close upon switching to Dashboard --- CHANGES.md | 4 ++-- frontend/src/app/main/ui/workspace/header.cljs | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 196fb3ecb..ef35fd381 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,9 +16,9 @@ - Fix join nodes icon is active when 2 already joined nodes are selected [Taiga #4370](https://tree.taiga.io/project/penpot/issue/4370) - Fix path nodes panel. "To curve" and "To corner" icons are active if node is already curved/cornered [Taiga #4371](https://tree.taiga.io/project/penpot/issue/4371) - Fix displaying comments settings are not applied via "Comments" menu drop-down on the top navbar on view mode [Taiga #4389](https://tree.taiga.io/project/penpot/issue/4389) -- Fix bad behaviour on hovering and click nested artboards[Taiga #4018](https://tree.taiga.io/project/penpot/issue/4018) and [Taiga #4269](https://tree.taiga.io/project/penpot/us/4269) +- Fix bad behaviour on hovering and click nested artboards [Taiga #4018](https://tree.taiga.io/project/penpot/issue/4018) and [Taiga #4269](https://tree.taiga.io/project/penpot/us/4269) - Fix lang autodetect issue [Taiga #4277](https://tree.taiga.io/project/penpot/issue/4277) - +- Fix colorpicker does not close upon switching to Dashboard [Taiga #4408](https://tree.taiga.io/project/penpot/issue/4408) ## 1.16.0-beta diff --git a/frontend/src/app/main/ui/workspace/header.cljs b/frontend/src/app/main/ui/workspace/header.cljs index 5c94db5a7..df3d1b0c6 100644 --- a/frontend/src/app/main/ui/workspace/header.cljs +++ b/frontend/src/app/main/ui/workspace/header.cljs @@ -13,6 +13,7 @@ [app.main.data.exports :as de] [app.main.data.modal :as modal] [app.main.data.workspace :as dw] + [app.main.data.workspace.colors :as dc] [app.main.data.workspace.libraries :as dwl] [app.main.data.workspace.shortcuts :as sc] [app.main.refs :as refs] @@ -434,10 +435,18 @@ zoom (mf/deref refs/selected-zoom) params {:page-id page-id :file-id (:id file) :section "interactions"} + close-modals + (mf/use-callback + (fn [] + (st/emit! (dc/stop-picker)) + (st/emit! (modal/hide!)))) + go-back (mf/use-callback (mf/deps project) - #(st/emit! (dw/go-to-dashboard project))) + (fn [] + (close-modals) + (st/emit! (dw/go-to-dashboard project)))) go-viewer (mf/use-callback