Skip to content

Commit 1c06bbc

Browse files
authored
fix(field-icon): do not scale icon when long hint (#878)
1 parent ea16c2a commit 1c06bbc

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/components/field-label/field-label.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ export const FieldLabel = props => {
4242

4343
{props.hint && (
4444
<Spacings.Inline alignItems="center" scale="xs">
45-
{props.hintIcon &&
46-
// FIXME: add proper tone when tones are refactored
47-
React.cloneElement(props.hintIcon, {
48-
size: 'medium',
49-
theme: props.hintIcon.props.theme || 'orange',
50-
})}
45+
{props.hintIcon && (
46+
<Spacings.Inline>
47+
{React.cloneElement(props.hintIcon, {
48+
// FIXME: add proper tone when tones are refactored
49+
size: 'medium',
50+
theme: props.hintIcon.props.theme || 'orange',
51+
})}
52+
</Spacings.Inline>
53+
)}
5154
{props.hint && <Text.Detail>{props.hint}</Text.Detail>}
5255
</Spacings.Inline>
5356
)}

src/components/field-label/field-label.visualroute.js

+8
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,13 @@ export const component = () => (
5050
horizontalConstraint="l"
5151
/>
5252
</Spec>
53+
<Spec label="with a very long hint">
54+
<FieldLabel
55+
title="Hello"
56+
hint="Sed vel condimentum lacus. Nam sit amet dui et magna tincidunt faucibus. Praesent gravida tempor semper. Donec et faucibus ante. Maecenas consectetur urna mi."
57+
hintIcon={<WarningIcon />}
58+
horizontalConstraint="m"
59+
/>
60+
</Spec>
5361
</Suite>
5462
);

0 commit comments

Comments
 (0)