|
1 | | -/*! nouislider - 14.5.0 - 5/11/2020 */ |
| 1 | +/*! nouislider - 14.6.0 - 6/27/2020 */ |
2 | 2 | (function(factory) { |
3 | 3 | if (typeof define === "function" && define.amd) { |
4 | 4 | // AMD. Register as an anonymous module. |
|
13 | 13 | })(function() { |
14 | 14 | "use strict"; |
15 | 15 |
|
16 | | - var VERSION = "14.5.0"; |
| 16 | + var VERSION = "14.6.0"; |
17 | 17 |
|
18 | 18 | //region Helper Methods |
19 | 19 |
|
|
654 | 654 | parsed.singleStep = entry; |
655 | 655 | } |
656 | 656 |
|
| 657 | + function testKeyboardPageMultiplier(parsed, entry) { |
| 658 | + if (!isNumeric(entry)) { |
| 659 | + throw new Error("noUiSlider (" + VERSION + "): 'keyboardPageMultiplier' is not numeric."); |
| 660 | + } |
| 661 | + |
| 662 | + parsed.keyboardPageMultiplier = entry; |
| 663 | + } |
| 664 | + |
| 665 | + function testKeyboardDefaultStep(parsed, entry) { |
| 666 | + if (!isNumeric(entry)) { |
| 667 | + throw new Error("noUiSlider (" + VERSION + "): 'keyboardDefaultStep' is not numeric."); |
| 668 | + } |
| 669 | + |
| 670 | + parsed.keyboardDefaultStep = entry; |
| 671 | + } |
| 672 | + |
657 | 673 | function testRange(parsed, entry) { |
658 | 674 | // Filter incorrect input. |
659 | 675 | if (typeof entry !== "object" || Array.isArray(entry)) { |
|
987 | 1003 | // Tests are executed in the order they are presented here. |
988 | 1004 | var tests = { |
989 | 1005 | step: { r: false, t: testStep }, |
| 1006 | + keyboardPageMultiplier: { r: false, t: testKeyboardPageMultiplier }, |
| 1007 | + keyboardDefaultStep: { r: false, t: testKeyboardDefaultStep }, |
990 | 1008 | start: { r: true, t: testStart }, |
991 | 1009 | connect: { r: true, t: testConnect }, |
992 | 1010 | direction: { r: true, t: testDirection }, |
|
1015 | 1033 | orientation: "horizontal", |
1016 | 1034 | keyboardSupport: true, |
1017 | 1035 | cssPrefix: "noUi-", |
1018 | | - cssClasses: cssClasses |
| 1036 | + cssClasses: cssClasses, |
| 1037 | + keyboardPageMultiplier: 5, |
| 1038 | + keyboardDefaultStep: 10 |
1019 | 1039 | }; |
1020 | 1040 |
|
1021 | 1041 | // AriaFormat defaults to regular format, if any. |
|
1856 | 1876 |
|
1857 | 1877 | // Move closest handle to tapped location. |
1858 | 1878 | function eventTap(event) { |
| 1879 | + // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with |
| 1880 | + // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore tap |
| 1881 | + // events that have no touches or buttons associated with them. |
| 1882 | + if (!event.buttons && !event.touches) { |
| 1883 | + return false; |
| 1884 | + } |
| 1885 | + |
1859 | 1886 | // The tap event shouldn't propagate up |
1860 | 1887 | event.stopPropagation(); |
1861 | 1888 |
|
|
1943 | 1970 | var to; |
1944 | 1971 |
|
1945 | 1972 | if (isUp || isDown) { |
1946 | | - var multiplier = 5; |
| 1973 | + var multiplier = options.keyboardPageMultiplier; |
1947 | 1974 | var direction = isDown ? 0 : 1; |
1948 | 1975 | var steps = getNextStepsForHandle(handleNumber); |
1949 | 1976 | var step = steps[direction]; |
|
1955 | 1982 |
|
1956 | 1983 | // No step set, use the default of 10% of the sub-range |
1957 | 1984 | if (step === false) { |
1958 | | - step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, 10); |
| 1985 | + step = scope_Spectrum.getDefaultStep( |
| 1986 | + scope_Locations[handleNumber], |
| 1987 | + isDown, |
| 1988 | + options.keyboardDefaultStep |
| 1989 | + ); |
1959 | 1990 | } |
1960 | 1991 |
|
1961 | 1992 | if (isLargeUp || isLargeDown) { |
|
0 commit comments