@sebgroup/green-react 3.29.1 → 3.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/slider/slider.js +2 -1
package/package.json
CHANGED
package/src/lib/slider/slider.js
CHANGED
|
@@ -66,7 +66,7 @@ function Slider(_ref2) {
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
var percent = 0;
|
|
69
|
-
if (sliderValue !== undefined) percent = (sliderValue - min) / (max - min) * 100;
|
|
69
|
+
if (sliderValue !== undefined) percent = Math.round((sliderValue - min) / step) / ((max - min) / step) * 100;
|
|
70
70
|
setBackground(getSliderTrackBackground(percent));
|
|
71
71
|
}, [disabled, sliderValue]);
|
|
72
72
|
var clamp = function clamp(unclamped) {
|
|
@@ -154,6 +154,7 @@ function Slider(_ref2) {
|
|
|
154
154
|
onChange: function onChange(e) {
|
|
155
155
|
return handleChange(e.currentTarget.value);
|
|
156
156
|
},
|
|
157
|
+
"aria-valuenow": sliderValue || 0,
|
|
157
158
|
style: {
|
|
158
159
|
background: background
|
|
159
160
|
}
|