Merge pull request #3997 from penpot/ladybenko-6490-fix-component-hover-ui

🐛 Fix assets UI
This commit is contained in:
Eva Marco 2024-01-11 10:24:36 +01:00 committed by GitHub
commit 65f7c9cbbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 76 deletions

View file

@ -23,6 +23,9 @@
editing? (unchecked-get props "editing")
dbl-click? (unchecked-get props "disable-dbl-click")
class (unchecked-get props "class")
tooltip (unchecked-get props "tooltip")
display-value (unchecked-get props "display-value")
final-class (dm/str class " " (stl/css :editable-label))
input-ref (mf/use-ref nil)
@ -82,15 +85,21 @@
(when (and editing? (not internal-editing?))
(start-edition)))
[:div {:class final-class}
[:input
{:class (stl/css :editable-label-input)
:ref input-ref
:default-value value
:on-key-up on-key-up
:on-double-click on-dbl-click
:on-blur cancel-edition}]
(if ^boolean internal-editing?
[:div {:class final-class}
[:input
{:class (stl/css :editable-label-input)
:ref input-ref
:default-value value
:on-key-up on-key-up
:on-double-click on-dbl-click
:on-blur cancel-edition}]
[:span {:class (stl/css :editable-label-close)
:on-click cancel-edition}
i/delete-text-refactor]]))
[:span {:class (stl/css :editable-label-close)
:on-click cancel-edition}
i/delete-text-refactor]]
[:span {:class final-class
:title tooltip
:on-double-click on-dbl-click}
display-value])))

View file

@ -36,7 +36,7 @@
encode-fn (unchecked-get context "encode-fn")
checked? (= selected value)]
[:label {:for id
[:label {:html-for id
:title title
:key unique-key
:class (stl/css-case
@ -104,6 +104,3 @@
[:div {:class (dm/str class " " (stl/css :radio-btn-wrapper))
:style {:width width}}
children]]))