0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

Merge pull request #2662 from penpot/palba-fix-cant-select-text-assets-inputs

🐛 Fix unable to select text at assets inputs in firefox
This commit is contained in:
Andrey Antukh 2022-12-16 09:35:00 +01:00 committed by GitHub
commit aefdbfa8ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View file

@ -19,6 +19,7 @@
- Fix twitter support account link [Taiga #4279](https://tree.taiga.io/project/penpot/issue/4279)
- Fix lang autodetect issue [Taiga #4277](https://tree.taiga.io/project/penpot/issue/4277)
- Fix adding an extra page on import [Taiga #4543](https://tree.taiga.io/project/penpot/task/4543)
- Fix unable to select text at assets inputs in firefox [Taiga #4572](https://tree.taiga.io/project/penpot/issue/4572)
### :arrow_up: Deps updates
### :heart: Community contributions by (Thank you!)

View file

@ -1286,7 +1286,7 @@
#(on-asset-click % (:id color)
(partial apply-color (:id color))))
:ref item-ref
:draggable (not workspace-read-only?)
:draggable (and (not workspace-read-only?) (not (:editing @state)))
:on-drag-start on-color-drag-start
:on-drag-enter on-drag-enter
:on-drag-leave on-drag-leave
@ -1557,6 +1557,8 @@
(let [item-ref (mf/use-ref)
dragging? (mf/use-state false)
workspace-read-only? (mf/use-ctx ctx/workspace-read-only?)
editing? (= editing-id (:id typography))
open? (mf/use-state editing?)
on-drop
(mf/use-fn
(mf/deps typography dragging? selected-typographies selected-typographies-full selected-typographies-paths move-typography)
@ -1587,7 +1589,7 @@
(on-asset-drag-start event typography selected-typographies item-ref :typographies identity))))]
[:div.typography-container {:ref item-ref
:draggable (not workspace-read-only?)
:draggable (and (not workspace-read-only?) (not @open?))
:on-drag-start on-typography-drag-start
:on-drag-enter on-drag-enter
:on-drag-leave on-drag-leave
@ -1603,8 +1605,9 @@
:selected? (contains? selected-typographies (:id typography))
:on-click #(on-asset-click % (:id typography)
(partial apply-typography typography))
:editing? (= editing-id (:id typography))
:focus-name? (= (:rename-typography local-data) (:id typography))}]
:editing? editing?
:focus-name? (= (:rename-typography local-data) (:id typography))
:open? open?}]
(when @dragging?
[:div.dragging])]))

View file

@ -456,9 +456,8 @@
;; In summary, this need to a good UX/UI/IMPL rework.
(mf/defc typography-entry
[{:keys [typography local? selected? on-click on-change on-detach on-context-menu editing? focus-name? file]}]
(let [open? (mf/use-state editing?)
hover-detach (mf/use-state false)
[{:keys [typography local? selected? on-click on-change on-detach on-context-menu editing? focus-name? file open?]}]
(let [hover-detach (mf/use-state false)
name-input-ref (mf/use-ref)
on-change-ref (mf/use-ref nil)
workspace-read-only? (mf/use-ctx ctx/workspace-read-only?)