Skip to content

Commit f6ef8a9

Browse files
committed
fix(Input, Navigation, Icon): fix Input line-height, Navigation icon does not display
1 parent e5df6e4 commit f6ef8a9

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

packages/fluent-ui-icons/src/utils/createIcon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function createIcon(jsx: JSX, componentName: string): React.ForwardRefExoticComp
1818
color: inherit;
1919
fill: currentColor;
2020
`
21-
SvgIconStyled.displayName = componentName
21+
SvgIconStyled.displayName = `FIcon${componentName}`
2222
return SvgIconStyled
2323
}
2424

packages/fluent-ui.com/src/docs/components/Icon/template.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ const Template = (): ReactElement => {
3737
return (
3838
<Box>
3939
{IconArray.map(
40-
(Icon): ReactElement => (
41-
<CopyToClipboard key={Icon.displayName} text={`<${Icon.displayName} />`}>
42-
<Button>
43-
<Icon />
44-
<span>{Icon.displayName}</span>
45-
</Button>
46-
</CopyToClipboard>
47-
)
40+
(Icon): ReactElement => {
41+
const name = String.prototype.substring.call(Icon.displayName, 5)
42+
return (
43+
<CopyToClipboard key={name} text={`<${name} />`}>
44+
<Button>
45+
<Icon />
46+
<span>{name}</span>
47+
</Button>
48+
</CopyToClipboard>
49+
)
50+
}
4851
)}
4952
</Box>
5053
)

packages/fluent-ui/src/Input/Input.styled.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const base = css`
1313
outline: none;
1414
width: 296px;
1515
height: ${inputSize}px;
16+
line-height: ${inputSize}px;
1617
font-size: 14px;
1718
padding: 6px 12px;
1819
font-family: ${th.font('input')};

packages/fluent-ui/src/Input/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
4545
type={password ? 'password' : 'text'}
4646
{...rest}
4747
/>
48-
{cleared && (
48+
{value && cleared && (
4949
<StyledIcon onClick={handleClear}>
5050
<ChromeCloseIcon />
5151
</StyledIcon>

0 commit comments

Comments
 (0)