|
418 | 418 | */
|
419 | 419 | resetSlider: function() {
|
420 | 420 | this.manageElementsStyle();
|
| 421 | + this.addAccessibility(); |
421 | 422 | this.setMinAndMax();
|
422 | 423 | this.updateCeilLab();
|
423 | 424 | this.updateFloorLab();
|
|
645 | 646 | addAccessibility: function() {
|
646 | 647 | this.minH.attr('role', 'slider');
|
647 | 648 | this.updateAriaAttributes();
|
648 |
| - if (this.options.keyboardSupport) |
| 649 | + if (this.options.keyboardSupport && !(this.options.readOnly || this.options.disabled)) |
649 | 650 | this.minH.attr('tabindex', '0');
|
| 651 | + else |
| 652 | + this.minH.attr('tabindex', ''); |
650 | 653 | if (this.options.vertical)
|
651 | 654 | this.minH.attr('aria-orientation', 'vertical');
|
652 | 655 |
|
653 | 656 | if (this.range) {
|
654 | 657 | this.maxH.attr('role', 'slider');
|
655 |
| - if (this.options.keyboardSupport) |
| 658 | + if (this.options.keyboardSupport && !(this.options.readOnly || this.options.disabled)) |
656 | 659 | this.maxH.attr('tabindex', '0');
|
| 660 | + else |
| 661 | + this.maxH.attr('tabindex', ''); |
657 | 662 | if (this.options.vertical)
|
658 | 663 | this.maxH.attr('aria-orientation', 'vertical');
|
659 | 664 | }
|
|
1370 | 1375 | newMinValue = newValue;
|
1371 | 1376 | newMinOffset = newOffset;
|
1372 | 1377 | newMaxValue = newValue + difference;
|
1373 |
| - if (newMaxValue > this.maxValue) return; |
| 1378 | + if (newMaxValue > this.maxValue) { |
| 1379 | + newMaxValue = this.maxValue; |
| 1380 | + newMinValue = newMaxValue - difference; |
| 1381 | + newMinOffset = this.valueToOffset(newMinValue); |
| 1382 | + } |
1374 | 1383 | newMaxOffset = this.valueToOffset(newMaxValue);
|
1375 | 1384 | } else {
|
1376 | 1385 | newMaxValue = newValue;
|
1377 | 1386 | newMaxOffset = newOffset;
|
1378 | 1387 | newMinValue = newValue - difference;
|
1379 |
| - if (newMinValue < this.minValue) return; |
| 1388 | + if (newMinValue < this.minValue) { |
| 1389 | + newMinValue = this.minValue; |
| 1390 | + newMaxValue = newMinValue + difference; |
| 1391 | + newMaxOffset = this.valueToOffset(newMaxValue); |
| 1392 | + } |
1380 | 1393 | newMinOffset = this.valueToOffset(newMinValue);
|
1381 | 1394 | }
|
1382 | 1395 | this.positionTrackingBar(newMinValue, newMaxValue, newMinOffset, newMaxOffset);
|
|
0 commit comments