Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/Slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,6 @@ class Rheostat extends React.Component {

// istanbul ignore next
updateNewValues(nextProps) {
// Don't update while the slider is sliding
if (this.state.slidingIndex !== null) {
return;
}

const { max, min, values } = nextProps;

const nextValues = this.validateValues(values, nextProps);
Expand Down
4 changes: 2 additions & 2 deletions test/slider-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ describe('<Slider />', () => {
assert(onChange.callCount === 0, 'onChange was not called');
});

it('should not update values if we are sliding', () => {
it('should update values when we are sliding', () => {
const onChange = sinon.spy();
const slider = mount(<Slider onChange={onChange} values={[0]} />);

slider.setState({ slidingIndex: 0 });

slider.setProps({ values: [50] });

assert(onChange.callCount === 0, 'updateNewValues was not called');
assert(onChange.callCount === 1, 'updateNewValues was called');
});

it('should not update values if they are the same', () => {
Expand Down