Skip to content

Commit d59875a

Browse files
authored
Fix the top margin of a button in a form (#5461)
* remove where * add example to cra * update example in cra
1 parent 9d8c74a commit d59875a

File tree

2 files changed

+14
-4
lines changed
  • examples/rsp-cra-18/src
  • packages/@adobe/spectrum-css-temp/components/fieldlabel

2 files changed

+14
-4
lines changed

examples/rsp-cra-18/src/App.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import './App.css';
2-
import {Provider, defaultTheme, Item, TagGroup, Cell, Column, Row, TableBody, TableHeader, TableView, Content, Heading} from '@adobe/react-spectrum';
2+
import {Provider, defaultTheme, Item, TagGroup, Cell, Column, Row, TableBody, TableHeader, TableView, Content, Heading, Form, ComboBox, Button} from '@adobe/react-spectrum';
33
import Lighting from './Lighting';
44
import {useState} from 'react'
55
import BodyContent from './BodyContent';
@@ -27,8 +27,7 @@ function App() {
2727

2828
return (
2929
<Provider theme={defaultTheme}
30-
colorScheme={selected ? "light" : "dark"}
31-
height="100%">
30+
colorScheme={selected ? "light" : "dark"}>
3231
<div className="content-padding">
3332
<Lighting selected={selected} switch={setSelection}/>
3433
<TagGroup aria-label="Static TagGroup items example">
@@ -56,6 +55,17 @@ function App() {
5655
<Heading>Payment Information</Heading>
5756
<Content>Enter your billing address, shipping address, and payment method to complete your purchase.</Content>
5857
</InlineAlert>
58+
<Form width="250px">
59+
<ComboBox label="Favorite Animal">
60+
<Item key="red panda">Red Panda</Item>
61+
<Item key="cat">Cat</Item>
62+
<Item key="dog">Dog</Item>
63+
<Item key="aardvark">Aardvark</Item>
64+
<Item key="kangaroo">Kangaroo</Item>
65+
<Item key="snake">Snake</Item>
66+
</ComboBox>
67+
<Button variant="cta">Click Me</Button>
68+
</Form>
5969
</div>
6070
</Provider>
6171
);

packages/@adobe/spectrum-css-temp/components/fieldlabel/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ governing permissions and limitations under the License.
196196
}
197197

198198
/* With labelPosition=top, we use a normal flex stack */
199-
&:where(.spectrum-Form--positionTop) {
199+
&.spectrum-Form--positionTop {
200200
display: flex;
201201
flex-direction: column;
202202
margin: 0;

0 commit comments

Comments
 (0)