Skip to content

Commit

Permalink
fix(NumberInput): correct disabled input and text styles (#6742)
Browse files Browse the repository at this point in the history
* fix(number-input): set light disabled number input background color

* fix(NumberInput): add disabled label and helper text classes

Co-authored-by: TJ Egan <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 28, 2020
1 parent 3d937a0 commit 91d8159
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@
background-color: $field-02;
}

.#{$prefix}--number--light input[type='number']:disabled,
.#{$prefix}--number--light
.#{$prefix}--number--readonly
input[type='number'] {
background-color: $field-02;
}

.#{$prefix}--number--mobile {
width: auto;
min-width: rem(144px);
Expand Down
7 changes: 6 additions & 1 deletion packages/react/src/components/NumberInput/NumberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,16 @@ class NumberInput extends Component {
);
}

const helperTextClasses = classNames(`${prefix}--form__helper-text`, {
[`${prefix}--form__helper-text--disabled`]: disabled,
});

const helper = helperText ? (
<div className={`${prefix}--form__helper-text`}>{helperText}</div>
<div className={helperTextClasses}>{helperText}</div>
) : null;

const labelClasses = classNames(`${prefix}--label`, {
[`${prefix}--label--disabled`]: disabled,
[`${prefix}--visually-hidden`]: hideLabel,
});

Expand Down

0 comments on commit 91d8159

Please sign in to comment.