Skip to content

Commit

Permalink
Fix inputnumbers as string
Browse files Browse the repository at this point in the history
  • Loading branch information
vigalo committed Mar 14, 2024
1 parent 67e1c46 commit 9edb20f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"@angular/platform-browser-dynamic": "^17.2.2",
"@angular/platform-server": "^17.2.2",
"@angular/router": "^17.2.2",
"@angular/ssr": "^17.2.1",
"@docsearch/js": "^3.3.4",
"@stackblitz/sdk": "1.9.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~4.3.1",
Expand All @@ -51,6 +53,7 @@
"codelyzer": "^0.0.28",
"del": "^7.1.0",
"domino": "^2.1.6",
"esbuild": "^0.19.8",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "latest",
Expand Down Expand Up @@ -84,9 +87,6 @@
"typedoc": "0.25.4",
"typescript": "5.2.2",
"xlsx": "^0.18.5",
"zone.js": "~0.14.0",
"@angular/ssr": "^17.2.1",
"@docsearch/js": "^3.3.4",
"esbuild": "^0.19.8"
"zone.js": "~0.14.0"
}
}
}
9 changes: 5 additions & 4 deletions src/app/components/inputnumber/inputnumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,10 +1379,11 @@ export class InputNumber implements OnInit, AfterContentInit, OnChanges, Control
onInputBlur(event: Event) {
this.focused = false;

let newValue = this.validateValue(this.parseValue(this.input.nativeElement.value)).toString();
this.input.nativeElement.value = this.formatValue(newValue);
this.input.nativeElement.setAttribute('aria-valuenow', newValue);
this.updateModel(event, newValue);
const newValueNumber = this.validateValue(this.parseValue(this.input.nativeElement.value));
const newValueString = newValueNumber?.toString();
this.input.nativeElement.value = this.formatValue(newValueString);
this.input.nativeElement.setAttribute('aria-valuenow', newValueString);
this.updateModel(event, newValueNumber);
this.onBlur.emit(event);
}

Expand Down

0 comments on commit 9edb20f

Please sign in to comment.