Skip to content

Commit

Permalink
fix(Input): resolve value=0 is valid when type is number
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Jun 20, 2023
1 parent 5caf7f8 commit 683ab92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ export default class Input extends SuperComponent {
updateValue(value) {
const { maxcharacter, maxlength } = this.properties;
if (maxcharacter && maxcharacter > 0 && !Number.isNaN(maxcharacter)) {
const { length, characters } = getCharacterLength('maxcharacter', value, maxcharacter);
const { length, characters } = getCharacterLength('maxcharacter', String(value), maxcharacter);
this.setData({
value: characters,
count: length,
});
} else if (maxlength > 0 && !Number.isNaN(maxlength)) {
const { length, characters } = getCharacterLength('maxlength', value, maxlength);
const { length, characters } = getCharacterLength('maxlength', String(value), maxlength);
this.setData({
value: characters,
count: length,
Expand Down

0 comments on commit 683ab92

Please sign in to comment.