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

Commit

Permalink
refactor(Slider): replace Carbon TextInput
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Mar 22, 2019
1 parent 68a9d40 commit 4c82f5b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import isEqual from 'lodash.isequal';
import { settings } from 'carbon-components';
import TextInput from '../TextInput';
import { sliderValuePropSync } from '../../internal/FeatureFlags';
import { componentsX } from '../../internal/FeatureFlags';

Expand Down Expand Up @@ -407,9 +406,14 @@ export default class Slider extends PureComponent {
className
);

const inputClasses = classNames(`${prefix}--slider-text-input`, {
[`${prefix}--text-input--light`]: light,
});
const inputClasses = classNames(
`${prefix}--text-input`,
`${prefix}--slider-text-input`,
{
[`${prefix}--text-input--light`]: light,
[`${prefix}--text-input--invalid`]: this.props.invalid,
}
);

const filledTrackStyle = {
transform: `translate(0%, -50%) scaleX(${left / 100})`,
Expand Down Expand Up @@ -483,7 +487,7 @@ export default class Slider extends PureComponent {
{formatLabel(max, maxLabel)}
</span>
{!hideTextInput && (
<TextInput
<input
type={inputType}
id={`${id}-input-for-slider`}
className={inputClasses}
Expand Down

0 comments on commit 4c82f5b

Please sign in to comment.