@@ -47,8 +47,10 @@ var _propTypes = require('./propTypes');
47
47
var internals = new WeakMap ( ) ;
48
48
49
49
var KeyCode = {
50
+ DOWN_ARROW : 40 ,
50
51
LEFT_ARROW : 37 ,
51
- RIGHT_ARROW : 39
52
+ RIGHT_ARROW : 39 ,
53
+ UP_ARROW : 38
52
54
} ;
53
55
54
56
function isWithinRange ( inputRange , values ) {
@@ -152,6 +154,8 @@ function renderSliders(inputRange) {
152
154
}
153
155
154
156
var slider = _react2 [ 'default' ] . createElement ( _Slider2 [ 'default' ] , {
157
+ ariaLabelledby : inputRange . props . ariaLabelledby ,
158
+ ariaControls : inputRange . props . ariaControls ,
155
159
classNames : classNames ,
156
160
key : key ,
157
161
maxValue : maxValue ,
@@ -316,10 +320,14 @@ var InputRange = (function (_React$Component) {
316
320
317
321
switch ( event . keyCode ) {
318
322
case KeyCode . LEFT_ARROW :
323
+ case KeyCode . DOWN_ARROW :
324
+ event . preventDefault ( ) ;
319
325
this . decrementValue ( key ) ;
320
326
break ;
321
327
322
328
case KeyCode . RIGHT_ARROW :
329
+ case KeyCode . UP_ARROW :
330
+ event . preventDefault ( ) ;
323
331
this . incrementValue ( key ) ;
324
332
break ;
325
333
@@ -334,6 +342,8 @@ var InputRange = (function (_React$Component) {
334
342
return ;
335
343
}
336
344
345
+ event . preventDefault ( ) ;
346
+
337
347
var key = getKeyByPosition ( this , position ) ;
338
348
339
349
this . updatePosition ( key , position ) ;
@@ -485,6 +495,7 @@ exports['default'] = InputRange;
485
495
486
496
InputRange . propTypes = {
487
497
ariaLabelledby : _react2 [ 'default' ] . PropTypes . string ,
498
+ ariaControls : _react2 [ 'default' ] . PropTypes . string ,
488
499
classNames : _react2 [ 'default' ] . PropTypes . objectOf ( _react2 [ 'default' ] . PropTypes . string ) ,
489
500
defaultValue : _propTypes . maxMinValuePropType ,
490
501
disabled : _react2 [ 'default' ] . PropTypes . bool ,
@@ -704,6 +715,7 @@ var Slider = (function (_React$Component) {
704
715
) ,
705
716
_react2 [ 'default' ] . createElement ( 'a' , {
706
717
'aria-labelledby' : this . props . ariaLabelledby ,
718
+ 'aria-controls' : this . props . ariaControls ,
707
719
'aria-valuemax' : this . props . maxValue ,
708
720
'aria-valuemin' : this . props . minValue ,
709
721
'aria-valuenow' : this . props . value ,
@@ -726,6 +738,7 @@ exports['default'] = Slider;
726
738
727
739
Slider . propTypes = {
728
740
ariaLabelledby : _react2 [ 'default' ] . PropTypes . string ,
741
+ ariaControls : _react2 [ 'default' ] . PropTypes . string ,
729
742
classNames : _react2 [ 'default' ] . PropTypes . objectOf ( _react2 [ 'default' ] . PropTypes . string ) ,
730
743
maxValue : _react2 [ 'default' ] . PropTypes . number ,
731
744
minValue : _react2 [ 'default' ] . PropTypes . number ,
0 commit comments