Skip to content

Commit 93fa74f

Browse files
authored
Fixing fieldlabel css so only textareas expand to fill available height (#1575)
1 parent c428cf5 commit 93fa74f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ governing permissions and limitations under the License.
7373
.spectrum-Field-field {
7474
/* If the user overrides the width of the field, propagate to the inner component */
7575
width: 100%;
76+
}
77+
78+
.spectrum-Field-field--multiline {
7679
flex: 1 1 auto;
7780
}
7881
}
@@ -84,10 +87,12 @@ governing permissions and limitations under the License.
8487
align-items: flex-start;
8588

8689
.spectrum-Field-field {
87-
/* If the user overrides the height of the field, propagate to the inner component */
88-
height: 100%;
8990
flex: 1;
9091
}
92+
93+
.spectrum-Field-field--multiline {
94+
height: 100%;
95+
}
9196
}
9297
}
9398

packages/@react-spectrum/combobox/src/ComboBox.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ interface ComboBoxInputProps extends SpectrumComboBoxProps<unknown> {
187187
inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement>,
188188
triggerProps: AriaButtonProps,
189189
triggerRef: RefObject<FocusableRefValue<HTMLElement>>,
190-
style?: React.CSSProperties
190+
style?: React.CSSProperties,
191+
className?: string
191192
}
192193

193194
const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref: RefObject<HTMLElement>) {
@@ -202,7 +203,7 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
202203
triggerRef,
203204
autoFocus,
204205
style,
205-
UNSAFE_className,
206+
className,
206207
loadingState,
207208
isOpen
208209
} = props;
@@ -245,7 +246,7 @@ const ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInp
245246
'spectrum-InputGroup--invalid': validationState === 'invalid',
246247
'is-hovered': isHovered
247248
},
248-
UNSAFE_className
249+
className
249250
)
250251
}>
251252
<TextFieldBase

packages/@react-spectrum/textfield/src/TextFieldBase.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) {
161161
);
162162

163163
textField = React.cloneElement(textField, mergeProps(textField.props, {
164-
className: classNames(labelStyles, 'spectrum-Field-field')
164+
className: classNames(
165+
labelStyles,
166+
'spectrum-Field-field',
167+
{
168+
'spectrum-Field-field--multiline': multiLine
169+
}
170+
)
165171
}));
166172

167173
return (

0 commit comments

Comments
 (0)