0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-01 09:31:26 -05:00

🐛 Fix outline in color type selector on view mode

This commit is contained in:
Eva 2023-01-09 16:05:40 +01:00
parent 2c2755b35e
commit 36bc276d93
5 changed files with 18 additions and 5 deletions

View file

@ -173,6 +173,11 @@
background-position: 95% 48%;
background-size: 10px;
cursor: pointer;
outline: none;
&:focus,
&:focus-within {
border: 1px solid $color-primary;
}
option {
padding: 1rem;

View file

@ -239,7 +239,6 @@ span.element-name {
margin-left: auto;
position: relative;
width: 32px;
right: 20px;
&.is-parent {
right: 0;

View file

@ -86,7 +86,8 @@
(dom/blur! input-node)))
(when esc?
(dom/prevent-default event)
(update-input value)))))
(update-input value)
(dom/blur! input-node)))))
handle-blur
(mf/use-callback

View file

@ -67,7 +67,7 @@
(when-not (:gradient color) [:div (str (* 100 (:opacity color)) "%")])]))
(when-not (and on-change-format (:gradient color))
[:select {:on-change #(-> (dom/get-target-val %) keyword on-change-format)}
[:select.color-format-select {:on-change #(-> (dom/get-target-val %) keyword on-change-format)}
[:option {:value "hex"}
(tr "inspect.attributes.color.hex")]

View file

@ -16,6 +16,7 @@
[app.main.ui.icons :as i]
[app.util.dom :as dom]
[app.util.i18n :refer [tr c]]
[app.util.keyboard :as kbd]
[rumext.v2 :as mf]))
(def exports-attrs
@ -123,7 +124,13 @@
(fn []
(st/emit! (dch/update-shapes ids
(fn [shape]
(assoc shape :exports []))))))]
(assoc shape :exports []))))))
manage-key-down
(mf/use-callback
(fn [event]
(let [esc? (kbd/esc? event)]
(when esc?
(dom/blur! (dom/get-target event))))))]
[:div.element-set.exports-options
[:div.element-set-title
@ -156,7 +163,8 @@
[:option {:value "6"} "6x"]])
[:input.input-text {:value (:suffix export)
:placeholder (tr "workspace.options.export.suffix")
:on-change (partial on-suffix-change index)}]
:on-change (partial on-suffix-change index)
:on-key-down manage-key-down}]
[:select.input-select {:value (name (:type export))
:on-change (partial on-type-change index)}
[:option {:value "png"} "PNG"]