@@ -47,8 +47,10 @@ var _propTypes = require('./propTypes');
4747var internals = new WeakMap ( ) ;
4848
4949var KeyCode = {
50+ DOWN_ARROW : 40 ,
5051 LEFT_ARROW : 37 ,
51- RIGHT_ARROW : 39
52+ RIGHT_ARROW : 39 ,
53+ UP_ARROW : 38
5254} ;
5355
5456function 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
486496InputRange . 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
727739Slider . 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