Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
fix: add disabled label styles (#2159)
Browse files Browse the repository at this point in the history
* fix(DatePickerInput): add disabled label styles

* fix(TimePicker): add disabled label styles
  • Loading branch information
emyarod authored and asudoh committed Apr 4, 2019
1 parent 4cb0509 commit fe9fd41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/DatePickerInput/DatePickerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class DatePickerInput extends Component {
const {
id,
labelText,
disabled,
invalid,
invalidText,
hideLabel,
Expand All @@ -59,12 +60,12 @@ export default class DatePickerInput extends Component {
const datePickerInputProps = {
id,
onChange: evt => {
if (!other.disabled) {
if (!disabled) {
onChange(evt);
}
},
onClick: evt => {
if (!other.disabled) {
if (!disabled) {
onClick(evt);
}
},
Expand All @@ -75,6 +76,7 @@ export default class DatePickerInput extends Component {

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

const datePickerIcon = (() => {
Expand Down Expand Up @@ -124,6 +126,7 @@ export default class DatePickerInput extends Component {
<input
{...other}
{...datePickerInputProps}
disabled={disabled}
ref={input => {
this.input = input;
}}
Expand All @@ -137,6 +140,7 @@ export default class DatePickerInput extends Component {
}}
{...other}
{...datePickerInputProps}
disabled={disabled}
className={`${prefix}--date-picker__input`}
/>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/TimePicker/TimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export default class TimePicker extends Component {

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

const label = labelText ? (
Expand Down

0 comments on commit fe9fd41

Please sign in to comment.