Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin-front committed Oct 26, 2017
2 parents d63b863 + 18d4fa3 commit 3e74742
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
30 changes: 22 additions & 8 deletions examples/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'rc-slider/assets/index.less';
import React from 'react';
import ReactDOM from 'react-dom';
import Slider from 'rc-slider';
import PropTypes from 'prop-types';

const Range = Slider.Range;

Expand Down Expand Up @@ -95,9 +94,25 @@ class DynamicBounds extends React.Component {
}

class ControlledRange extends React.Component {
static propTypes = {
allowCross: PropTypes.bool,
constructor(props) {
super(props);
this.state = {
value: [20, 40, 60, 80],
};
}
handleChange = (value) => {
this.setState({
value,
});
}
render() {
return (
<Range value={this.state.value} onChange={this.handleChange} />
);
}
}

class ControlledRangeDisableAcross extends React.Component {
constructor(props) {
super(props);
this.state = {
Expand All @@ -110,9 +125,8 @@ class ControlledRange extends React.Component {
});
}
render() {
const { allowCross = true } = this.props;
return (
<Range value={this.state.value} onChange={this.handleChange} allowCross={allowCross}/>
<Range value={this.state.value} onChange={this.handleChange} allowCross={false} />
);
}
}
Expand Down Expand Up @@ -161,9 +175,9 @@ ReactDOM.render(
<ControlledRange />
</div>
<div style={style}>
<p>Controlled Range with not allowCross</p>
<ControlledRange allowCross={false} />
</div>
<p>Controlled Range, not allow across</p>
<ControlledRangeDisableAcross />
</div>
<div style={style}>
<p>Multi Range</p>
<Range count={3} defaultValue={[20, 40, 60, 80]} pushable />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-slider",
"version": "8.3.4",
"version": "8.3.5",
"description": "Slider UI component for React",
"keywords": [
"react",
Expand Down
1 change: 1 addition & 0 deletions src/Slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class Slider extends React.Component {
disabled,
min,
max,
index: 0,
style: handleStyle[0] || handleStyle,
ref: h => this.saveHandle(0, h),
});
Expand Down
2 changes: 1 addition & 1 deletion tests/setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
global.requestAnimationFrame = global.requestAnimationFrame || function raf(cb) {
global.requestAnimationFrame = global.requestAnimationFrame || function _raf(cb) {
return setTimeout(cb, 0);
};

Expand Down

0 comments on commit 3e74742

Please sign in to comment.