Skip to content

Commit 8692e9d

Browse files
kristofferjsrexxars
authored andcommitted
[components] Radioselect with using flex, Fixes #528
1 parent cff3049 commit 8692e9d

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

packages/@sanity/components/src/selects/styles/RadioSelect.css

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88

99
.horizontal {
1010
composes: root;
11+
12+
@nest & .radioContainer {
13+
display: flex;
14+
flex-wrap: wrap;
15+
}
1116
}
1217

1318
.container {
1419
display: block;
1520
}
1621

1722
.item {
18-
@nest .horizontal & {
19-
margin-right: 1rem;
20-
float: left;
21-
}
23+
margin-right: 1rem;
2224
}

packages/test-studio/schemas/strings.js

+25
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ export default {
4141
]
4242
}
4343
},
44+
{
45+
name: 'radioSelectHorizontal',
46+
title: 'Select (layout: radio, direction: horizontal)',
47+
type: 'string',
48+
description: 'Select a single string value by choosing options from a list of radio buttons. It should *not* be possible to unset a selected value once its set.',
49+
options: {
50+
layout: 'radio',
51+
direction: 'horizontal',
52+
list: [
53+
{
54+
title: 'One (1)',
55+
value: 'one'
56+
},
57+
{
58+
title: 'Two (2)',
59+
value: 'two'
60+
},
61+
{
62+
title: 'Three (3)',
63+
value: 'three'
64+
}
65+
]
66+
}
67+
},
4468
{
4569
name: 'selectObjectOfString',
4670
title: 'Select string in object',
@@ -57,6 +81,7 @@ export default {
5781
description: 'Select a single string value by choosing options from a list of radio buttons. It should *not* be possible to unset a selected value once its set.',
5882
options: {
5983
layout: 'radio',
84+
direction: 'vertical',
6085
list: [
6186
{
6287
title: 'One (1)',

0 commit comments

Comments
 (0)