🐛 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:
Belén Albeza 2025-02-03 09:51:26 +01:00 committed by GitHub
parent e486bb4bec
commit fe5de94db4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 484 additions and 10 deletions

View file

@ -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]]))