0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

🐛 Fix double click crash on viewer layers

This commit is contained in:
Eva 2022-06-21 10:45:26 +02:00
parent 95829ff3de
commit ac1167d0c9
3 changed files with 12 additions and 4 deletions

View file

@ -1,5 +1,11 @@
# CHANGELOG
## 1.14.1-beta
### :bug: Bugs fixed
- Fix crash when double click on viewer assets [Taiga #3625](https://tree.taiga.io/project/penpot/issue/3625)
## 1.14.0-beta
### :sparkles: New features
@ -13,6 +19,7 @@
- Navigate to the original link after log in [Taiga #3624](https://tree.taiga.io/project/penpot/issue/3624)
### :bug: Bugs fixed
- Fix menu file not accessible in certain conditions [Taiga #3385](https://tree.taiga.io/project/penpot/issue/3385)
- Remove deprecated menu options [Taiga #3333](https://tree.taiga.io/project/penpot/issue/3333)
- Prototype connection should be under the rules [Taiga #3384](https://tree.taiga.io/project/penpot/issue/3384)

View file

@ -72,7 +72,7 @@
:icon-layer (= (:type item) :icon))
:on-click select-shape}
[:& si/element-icon {:shape item}]
[:& layer-name {:shape item}]
[:& layer-name {:shape item :disabled-double-click true}]
(when (and (not disable-collapse?) (:shapes item))
[:span.toggle-content

View file

@ -32,13 +32,14 @@
(l/derived (l/in [:workspace-local :shape-for-rename]) st/state))
(mf/defc layer-name
[{:keys [shape on-start-edit on-stop-edit name-ref] :as props}]
[{:keys [shape on-start-edit disabled-double-click on-stop-edit name-ref] :as props}]
(let [local (mf/use-state {})
shape-for-rename (mf/deref shape-for-rename-ref)
start-edit (fn []
(on-start-edit)
(swap! local assoc :edition true))
(when (not disabled-double-click)
(on-start-edit)
(swap! local assoc :edition true)))
accept-edit (fn []
(let [name-input (mf/ref-val name-ref)