Skip to content

Commit

Permalink
fix: input disabled state is greyed out again
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoya committed Oct 3, 2019
1 parent 63fbcf0 commit 6290f88
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ exports[`simple form render 1`] = `
font-size: 1rem;
}
.c9[disabled] {
background-color: #ECEEF5;
}
.c8 {
box-sizing: border-box;
display: -webkit-box;
Expand Down
5 changes: 3 additions & 2 deletions packages/big-design/src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ class StyleableInput extends React.PureComponent<InputProps & PrivateProps, Inpu
private readonly uniqueId = uniqueId('input_');

render() {
const { chips, description, error, label, forwardedRef, onChipDelete, ...props } = this.props;
const { chips, description, disabled, error, label, forwardedRef, onChipDelete, ...props } = this.props;
const id = this.getId();

return (
<div>
{this.renderLabel()}
{this.renderDescription()}
<StyledInputWrapper error={error} focus={this.state.focus}>
<StyledInputWrapper disabled={disabled} error={error} focus={this.state.focus}>
{this.renderIconLeft()}
<StyledInputContent chips={chips}>
{this.renderChips()}
<StyledInput
{...props}
disabled={disabled}
chips={chips}
error={error}
id={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ exports[`renders all together 1`] = `
font-size: 1rem;
}
.c7[disabled] {
background-color: #ECEEF5;
}
.c4 {
color: #5E637A;
-webkit-flex: 0 0 1.5rem;
Expand Down
4 changes: 4 additions & 0 deletions packages/big-design/src/components/Input/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const StyledInput = styled.input<InputProps>`
css`
padding-left: ${props.theme.spacing.xxSmall};
`};
&[disabled] {
background-color: ${({ theme }) => theme.colors.secondary20};
}
`;

export const StyledIconWrapper = styled.div`
Expand Down

0 comments on commit 6290f88

Please sign in to comment.