Skip to content

Commit 794e6de

Browse files
committed
Release v0.7.0
1 parent 0ae2fe6 commit 794e6de

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

Diff for: bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"dist/react-input-range.js",
55
"dist/react-input-range.css"
66
],
7-
"version": "0.6.2",
7+
"version": "0.7.0",
88
"description": "React component for inputting numeric values within a range",
99
"homepage": "https://github.com/davidchin/react-input-range",
1010
"authors": [

Diff for: dist/react-input-range.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ var _propTypes = require('./propTypes');
4747
var internals = new WeakMap();
4848

4949
var KeyCode = {
50+
DOWN_ARROW: 40,
5051
LEFT_ARROW: 37,
51-
RIGHT_ARROW: 39
52+
RIGHT_ARROW: 39,
53+
UP_ARROW: 38
5254
};
5355

5456
function isWithinRange(inputRange, values) {
@@ -152,6 +154,8 @@ function renderSliders(inputRange) {
152154
}
153155

154156
var slider = _react2['default'].createElement(_Slider2['default'], {
157+
ariaLabelledby: inputRange.props.ariaLabelledby,
158+
ariaControls: inputRange.props.ariaControls,
155159
classNames: classNames,
156160
key: key,
157161
maxValue: maxValue,
@@ -316,10 +320,14 @@ var InputRange = (function (_React$Component) {
316320

317321
switch (event.keyCode) {
318322
case KeyCode.LEFT_ARROW:
323+
case KeyCode.DOWN_ARROW:
324+
event.preventDefault();
319325
this.decrementValue(key);
320326
break;
321327

322328
case KeyCode.RIGHT_ARROW:
329+
case KeyCode.UP_ARROW:
330+
event.preventDefault();
323331
this.incrementValue(key);
324332
break;
325333

@@ -334,6 +342,8 @@ var InputRange = (function (_React$Component) {
334342
return;
335343
}
336344

345+
event.preventDefault();
346+
337347
var key = getKeyByPosition(this, position);
338348

339349
this.updatePosition(key, position);
@@ -485,6 +495,7 @@ exports['default'] = InputRange;
485495

486496
InputRange.propTypes = {
487497
ariaLabelledby: _react2['default'].PropTypes.string,
498+
ariaControls: _react2['default'].PropTypes.string,
488499
classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),
489500
defaultValue: _propTypes.maxMinValuePropType,
490501
disabled: _react2['default'].PropTypes.bool,
@@ -704,6 +715,7 @@ var Slider = (function (_React$Component) {
704715
),
705716
_react2['default'].createElement('a', {
706717
'aria-labelledby': this.props.ariaLabelledby,
718+
'aria-controls': this.props.ariaControls,
707719
'aria-valuemax': this.props.maxValue,
708720
'aria-valuemin': this.props.minValue,
709721
'aria-valuenow': this.props.value,
@@ -726,6 +738,7 @@ exports['default'] = Slider;
726738

727739
Slider.propTypes = {
728740
ariaLabelledby: _react2['default'].PropTypes.string,
741+
ariaControls: _react2['default'].PropTypes.string,
729742
classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),
730743
maxValue: _react2['default'].PropTypes.number,
731744
minValue: _react2['default'].PropTypes.number,

0 commit comments

Comments
 (0)