Skip to content

Commit d0b4e58

Browse files
tassoevanggazzo
authored andcommitted
fix: InputControl width (#75)
* Update dependencies * Force a sane minimum width for InputControl
1 parent 88e0f14 commit d0b4e58

File tree

6 files changed

+501
-457
lines changed

6 files changed

+501
-457
lines changed

packages/fuselage/.storybook/jest-results.json

+1-1
Large diffs are not rendered by default.

packages/fuselage/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"update-storybook": "run-s test:results build-storybook loki:update"
3636
},
3737
"peerDependencies": {
38-
"@rocket.chat/fuselage-hooks": "^0.2.0-alpha.6",
38+
"@rocket.chat/fuselage-hooks": "^0.2.0-alpha.9",
3939
"react": "^16.8.6",
4040
"styled-components": "^4.4.0"
4141
},

packages/fuselage/src/components/InputBox/styles.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ const withIconAddonColors = ({
9696
export const Input = styled(InputControl)`
9797
flex: 1 0 auto;
9898
99-
width: 0;
100-
10199
${ ({ theme }) => withIconAddonColors(theme.inputColors.normal) }
102100
103101
&:invalid,
@@ -110,6 +108,11 @@ export const Input = styled(InputControl)`
110108
&.disabled + ${ Addon } {
111109
pointer-events: none;
112110
}
111+
112+
${ Wrapper } > & {
113+
min-width: 0;
114+
width: 0;
115+
}
113116
`;
114117

115118
export const StyledInputBoxSkeleton = styled.span`

packages/fuselage/src/components/InputControl/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ export const InputControl = React.forwardRef(function InputControl({
3030
|| (type === 'select' && 'select')
3131
|| 'input'}
3232
className={compoundClassName}
33+
cols={
34+
(type === 'textarea' && 1)
35+
|| (type === 'select' && 0)
36+
|| 0}
3337
ref={mergedRef}
38+
size={
39+
(type === 'textarea' && undefined)
40+
|| (type === 'select' && 1)
41+
|| 1}
3442
theme={theme}
3543
type={type === 'textarea' || type === 'select' ? undefined : type}
3644
htmlType={type}

packages/fuselage/src/components/InputControl/styles.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ export const StyledInputControl = styled.input`
8989
9090
flex: 0 0 auto;
9191
92-
width: 8rem;
93-
min-width: 0;
92+
min-width: 8rem;
9493
9594
background-color: transparent;
9695

0 commit comments

Comments
 (0)