Skip to content

Commit 411583c

Browse files
committed
fix(ui5-step-input): prevent false validation error with valuePrecision
1 parent d8adb03 commit 411583c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

packages/main/src/StepInput.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,13 @@ class StepInput extends UI5Element implements IFormInputElement {
513513
}
514514

515515
get _isValueWithCorrectPrecision() {
516+
// checks if the value will be displayed with correct precision
517+
// _displayValue has special formatting logic
518+
if ((this.value === 0) || (Number.isInteger(this.value))) {
519+
// integers and zero will be formatted with toFixed, so they're always valid
520+
return true;
521+
}
522+
516523
// gets either "." or "," as delimiter which is based on locale, and splits the number by it
517524
const delimiter = this.input?.value?.includes(".") ? "." : ",";
518525
const numberParts = this.input?.value?.split(delimiter);

0 commit comments

Comments
 (0)