0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-09 21:41:23 -05:00

🐛 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 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)
- Fix toolbar disappearing [Taiga #7411](https://tree.taiga.io/project/penpot/issue/7411)
## 1.19.5

View file

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

View file

@ -333,7 +333,7 @@
;; NOTE: Neither get-parent-at nor get-parent-with-selector
;; work if the component template changes, so we need to
;; 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)
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-pointer-down (mf/use-fn
(mf/deps drawing-tool drawing-path?)
(fn [_]
(when drawing-path?
(st/emit! (dwe/clear-edition-mode)))))
(fn [e]
(let [target (dom/get-target e)
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)))]
(mf/use-effect

View file

@ -142,7 +142,8 @@
(fn [_]
(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)}
;; Draw Mode

View file

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