🐛 Fix toolbar disappearing

This commit is contained in:
AzazelN28 2024-04-11 10:41:51 +02:00 committed by Alonso Torres
parent b684ee2f83
commit a569a350b4
6 changed files with 16 additions and 11 deletions

View file

@ -131,7 +131,7 @@
- Fix problem with fix scrolling on nested elements [Github #3508](https://github.com/penpot/penpot/issues/3508) - Fix problem with fix scrolling on nested elements [Github #3508](https://github.com/penpot/penpot/issues/3508)
- Fix problem when changing typography assets [Github #3683](https://github.com/penpot/penpot/issues/3683) - Fix problem when changing typography assets [Github #3683](https://github.com/penpot/penpot/issues/3683)
- Internal error when you copy and paste some main components between files [Taiga #7397](https://tree.taiga.io/project/penpot/issue/7397) - Internal error when you copy and paste some main components between files [Taiga #7397](https://tree.taiga.io/project/penpot/issue/7397)
- Fix toolbar disappearing [Taiga #7411](https://tree.taiga.io/project/penpot/issue/7411)
## 1.19.5 ## 1.19.5

View file

@ -357,7 +357,8 @@
(common/finish-path) (common/finish-path)
(dwdc/clear-drawing))))))) (dwdc/clear-drawing)))))))
(defn change-edit-mode [mode] (defn change-edit-mode
[mode]
(ptk/reify ::change-edit-mode (ptk/reify ::change-edit-mode
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]

View file

@ -333,7 +333,7 @@
;; NOTE: Neither get-parent-at nor get-parent-with-selector ;; NOTE: Neither get-parent-at nor get-parent-with-selector
;; work if the component template changes, so we need to ;; work if the component template changes, so we need to
;; seek for an alternate solution. Maybe use-context? ;; seek for an alternate solution. Maybe use-context?
scroll-node (dom/get-parent-with-data node "scrollContainer") scroll-node (dom/get-parent-with-data node "scroll-container")
parent-node (dom/get-parent-at node 2) parent-node (dom/get-parent-at node 2)
first-child-node (dom/get-first-child parent-node) first-child-node (dom/get-first-child parent-node)

View file

@ -47,9 +47,11 @@
on-paste (actions/on-paste disable-paste in-viewport? workspace-read-only?) on-paste (actions/on-paste disable-paste in-viewport? workspace-read-only?)
on-pointer-down (mf/use-fn on-pointer-down (mf/use-fn
(mf/deps drawing-tool drawing-path?) (mf/deps drawing-tool drawing-path?)
(fn [_] (fn [e]
(when drawing-path? (let [target (dom/get-target e)
(st/emit! (dwe/clear-edition-mode))))) parent? (dom/get-parent-with-data target "dont-clear-path")]
(when (and drawing-path? (not parent?))
(st/emit! (dwe/clear-edition-mode))))))
on-blur (mf/use-fn #(st/emit! (mse/->BlurEvent)))] on-blur (mf/use-fn #(st/emit! (mse/->BlurEvent)))]
(mf/use-effect (mf/use-effect

View file

@ -142,7 +142,8 @@
(fn [_] (fn [_]
(st/emit! (drp/toggle-snap))))] (st/emit! (drp/toggle-snap))))]
[:div {:class (stl/css :sub-actions)} [:div {:class (stl/css :sub-actions)
:data-dont-clear-path true}
[:div {:class (stl/css :sub-actions-group)} [:div {:class (stl/css :sub-actions-group)}
;; Draw Mode ;; Draw Mode

View file

@ -169,10 +169,11 @@
(defn get-parent-with-data (defn get-parent-with-data
[^js node name] [^js node name]
(loop [current node] (let [name (str/camel name)]
(if (or (nil? current) (obj/in? (.-dataset current) name)) (loop [current node]
current (if (or (nil? current) (obj/in? (.-dataset current) name))
(recur (.-parentElement current))))) current
(recur (.-parentElement current))))))
(defn get-parent-with-selector (defn get-parent-with-selector
[^js node selector] [^js node selector]