We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce7dfe1 commit 6599216Copy full SHA for 6599216
1 file changed
src/components/widgets/NumericInput.js
@@ -85,18 +85,12 @@ export default class NumericInput extends Component {
85
86
let valueUpdate;
87
if (isNumeric(value)) {
88
+ const x = parseFloat(value);
89
+ const absMode = stepmode === 'absolute';
90
if (direction === 'increase') {
- if (stepmode === 'absolute') {
- valueUpdate = parseFloat(value) + step;
91
- } else {
92
- valueUpdate = parseFloat(value) * (1 + step);
93
- }
+ valueUpdate = absMode ? x + step : x * (1 + step);
94
} else {
95
96
- valueUpdate = parseFloat(value) - step;
97
98
- valueUpdate = parseFloat(value) / (1 + step);
99
+ valueUpdate = absMode ? x - step : x / (1 + step);
100
}
101
102
// if we are multi-valued and the user is incrementing or decrementing
0 commit comments