diff --git a/examples/marks.js b/examples/marks.js index 7592dca..eef1fc2 100644 --- a/examples/marks.js +++ b/examples/marks.js @@ -8,6 +8,7 @@ var Slider = require('rc-slider'); var style = {width: 400, margin: 50}; var marks = { + '-10': '-10°C', 0: '0°C', 26: '26°C', 37: '37°C', @@ -22,29 +23,29 @@ ReactDOM.render(

Slider with marks, `included=true`

- +

Slider with marks and steps, `included=true`

- +

Slider with marks, `included=false`

- +

Slider with marks and steps, `included=false`

- +

Range with marks

- +

Range with marks and steps

- +
, document.getElementById('__react-content')); diff --git a/package.json b/package.json index fd1ec6a..deab63d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-slider", - "version": "3.0.0", + "version": "3.0.1", "description": "slider ui component for react", "keywords": [ "react", diff --git a/src/Marks.jsx b/src/Marks.jsx index db7ace7..f4eaf49 100644 --- a/src/Marks.jsx +++ b/src/Marks.jsx @@ -17,13 +17,7 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) = }); const style = { width: markWidth }; - if (point === marksCount - 1) { - style.right = -unit / 4 + '%'; - } else if (point === 0) { - style.left = -unit / 4 + '%'; - } else { - style.left = (point - min) / range * 100 - unit / 4 + '%'; - } + style.left = (point - min) / range * 100 - unit / 4 + '%'; return ( {marks[point]}