Skip to content

Commit f68e64b

Browse files
authored
fixing height of textareas with labels so they grow to fill the specified height (#1518)
1 parent 9112150 commit f68e64b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ governing permissions and limitations under the License.
2020

2121
.spectrum-FieldLabel {
2222
display: flex;
23+
flex: 0 0 auto;
2324

2425
box-sizing: border-box;
2526

@@ -70,6 +71,7 @@ governing permissions and limitations under the License.
7071
.spectrum-Field-field {
7172
/* If the user overrides the width of the field, propagate to the inner component */
7273
width: 100%;
74+
flex: 1 1 auto;
7375
}
7476
}
7577

@@ -80,6 +82,8 @@ governing permissions and limitations under the License.
8082
align-items: flex-start;
8183

8284
.spectrum-Field-field {
85+
/* If the user overrides the height of the field, propagate to the inner component */
86+
height: 100%;
8387
flex: 1;
8488
}
8589
}

packages/@react-spectrum/textfield/stories/TextArea.stories.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import {action} from '@storybook/addon-actions';
1414
import {Button} from '@react-spectrum/button';
15+
import {Form} from '@react-spectrum/form';
1516
import Info from '@spectrum-icons/workflow/Info';
1617
import React, {useState} from 'react';
1718
import {storiesOf} from '@storybook/react';
@@ -121,6 +122,17 @@ storiesOf('TextArea', module)
121122
.add('custom width, quiet',
122123
() => render({icon: <Info />, validationState: 'invalid', width: '300px', isQuiet: true})
123124
)
125+
.add(
126+
'custom height with label',
127+
() => (
128+
<Form>
129+
<TextArea label="Height size-2000" height="size-2000" />
130+
<TextArea label="Height size-2000" height="size-2000" isQuiet />
131+
<TextArea labelPosition="side" label="Height size-2000" height="size-2000" />
132+
<TextArea labelPosition="side" label="Height size-2000" height="size-2000" isQuiet />
133+
</Form>
134+
)
135+
)
124136
.add('controlled interactive',
125137
() => <ControlledTextArea />
126138
);

0 commit comments

Comments
 (0)