mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 14:26:10 +02:00
🐛 Fix "Mixed" not showing up for layout padding inputs (#5741)
* 🐛 Fix layout padding inputs not showing 'mixed' text * ✨ Add integration test
This commit is contained in:
parent
e486bb4bec
commit
fe5de94db4
7 changed files with 484 additions and 10 deletions
|
@ -303,12 +303,12 @@
|
|||
p1 (if (and (not (= :multiple value))
|
||||
(= p1 p3))
|
||||
p1
|
||||
"--")
|
||||
nil)
|
||||
|
||||
p2 (if (and (not (= :multiple value))
|
||||
(= p2 p4))
|
||||
p2
|
||||
"--")
|
||||
nil)
|
||||
|
||||
on-change'
|
||||
(mf/use-fn
|
||||
|
@ -334,30 +334,34 @@
|
|||
|
||||
[:div {:class (stl/css :paddings-simple)}
|
||||
[:div {:class (stl/css :padding-simple)
|
||||
:title "Vertical padding"}
|
||||
:title (tr "workspace.layout_grid.editor.padding.vertical")}
|
||||
[:span {:class (stl/css :icon)}
|
||||
i/padding-top-bottom]
|
||||
[:> numeric-input*
|
||||
{:class (stl/css :numeric-input)
|
||||
:placeholder "--"
|
||||
:placeholder (tr "settings.multiple")
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.vertical")
|
||||
:data-attr "p1"
|
||||
:on-change on-change'
|
||||
:on-focus on-focus
|
||||
:nillable true
|
||||
:min 0
|
||||
:value p1}]]
|
||||
[:div {:class (stl/css :padding-simple)
|
||||
:title "Horizontal padding"}
|
||||
:title (tr "workspace.layout_grid.editor.padding.horizontal")}
|
||||
|
||||
[:span {:class (stl/css :icon)}
|
||||
i/padding-left-right]
|
||||
[:> numeric-input*
|
||||
{:className (stl/css :numeric-input)
|
||||
:placeholder "--"
|
||||
:placeholder (tr "settings.multiple")
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.horizontal")
|
||||
:data-attr "p2"
|
||||
:on-change on-change'
|
||||
:on-focus on-focus
|
||||
:on-blur on-padding-blur
|
||||
:min 0
|
||||
:nillable true
|
||||
:value p2}]]]))
|
||||
|
||||
(mf/defc multiple-padding-selection
|
||||
|
@ -389,12 +393,13 @@
|
|||
|
||||
[:div {:class (stl/css :paddings-multiple)}
|
||||
[:div {:class (stl/css :padding-multiple)
|
||||
:title "Top padding"}
|
||||
:title (tr "workspace.layout_grid.editor.padding.top")}
|
||||
[:span {:class (stl/css :icon)}
|
||||
i/padding-top]
|
||||
[:> numeric-input*
|
||||
{:class (stl/css :numeric-input)
|
||||
:placeholder "--"
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.top")
|
||||
:data-attr "p1"
|
||||
:on-change on-change'
|
||||
:on-focus on-focus
|
||||
|
@ -403,12 +408,13 @@
|
|||
:value p1}]]
|
||||
|
||||
[:div {:class (stl/css :padding-multiple)
|
||||
:title "Right padding"}
|
||||
:title (tr "workspace.layout_grid.editor.padding.right")}
|
||||
[:span {:class (stl/css :icon)}
|
||||
i/padding-right]
|
||||
[:> numeric-input*
|
||||
{:class (stl/css :numeric-input)
|
||||
:placeholder "--"
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.right")
|
||||
:data-attr "p2"
|
||||
:on-change on-change'
|
||||
:on-focus on-focus
|
||||
|
@ -417,12 +423,13 @@
|
|||
:value p2}]]
|
||||
|
||||
[:div {:class (stl/css :padding-multiple)
|
||||
:title "Bottom padding"}
|
||||
:title (tr "workspace.layout_grid.editor.padding.bottom")}
|
||||
[:span {:class (stl/css :icon)}
|
||||
i/padding-bottom]
|
||||
[:> numeric-input*
|
||||
{:class (stl/css :numeric-input)
|
||||
:placeholder "--"
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.bottom")
|
||||
:data-attr "p3"
|
||||
:on-change on-change'
|
||||
:on-focus on-focus
|
||||
|
@ -431,12 +438,13 @@
|
|||
:value p3}]]
|
||||
|
||||
[:div {:class (stl/css :padding-multiple)
|
||||
:title "Left padding"}
|
||||
:title (tr "workspace.layout_grid.editor.padding.left")}
|
||||
[:span {:class (stl/css :icon)}
|
||||
i/padding-left]
|
||||
[:> numeric-input*
|
||||
{:class (stl/css :numeric-input)
|
||||
:placeholder "--"
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.left")
|
||||
:data-attr "p4"
|
||||
:on-change on-change'
|
||||
:on-focus on-focus
|
||||
|
@ -476,6 +484,7 @@
|
|||
:padding-toggle true
|
||||
:selected (= type :multiple))
|
||||
:title (tr "workspace.layout_grid.editor.padding.expand")
|
||||
:aria-label (tr "workspace.layout_grid.editor.padding.expand")
|
||||
:data-type (d/name type)
|
||||
:on-click on-type-change'}
|
||||
i/padding-extended]]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue