Skip to content

Commit 6b9e325

Browse files
committed
UIEXT-2930: Ensure step size is always non-zero
UIEXT-2930 (Add configurable step size to NumberInputWidget)
1 parent 2680e7c commit 6b9e325

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/components/src/components/forms/NumberInput/NumberInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default {
9191
return this.type === "integer";
9292
},
9393
stepSize() {
94-
if (this.step !== null) {
94+
if (this.step !== null && this.step !== 0) {
9595
return this.step;
9696
}
9797
@@ -212,7 +212,7 @@ export default {
212212
213213
/** Mimic stepping to nearest step with safe value rounding */
214214
let parsedVal = value + increment;
215-
let scaleFactor = 1 / Math.abs(increment); // eslint-disable-line no-magic-numbers
215+
let scaleFactor = 1 / Math.abs(increment);
216216
if (Math.abs(increment) < 1) {
217217
// Avoid rounding errors induced by fractional increments
218218
scaleFactor = Math.round(scaleFactor);

0 commit comments

Comments
 (0)