Skip to content

Commit

Permalink
fix(input-number): doesn't change with /- buttons if you delete its c…
Browse files Browse the repository at this point in the history
…ontent at least once(tusen-ai#251)
  • Loading branch information
doom-9 committed Jun 23, 2021
1 parent fd23a30 commit d62d4ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### Fixes

- `n-select` can't input in filterable mode in single mode in iOS Safari, closes [#230](https://github.com/TuSimple/naive-ui/issues/230)
- `n-input-number` doesn't change with /- buttons if you delete its content at least once, closes [#251](https://github.com/TuSimple/naive-ui/issues/251)

## 2.13.0 (2021-06-21)

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
### Fixes

- `n-select` 在可过滤单选模式下在 iOS Safari 无法输入,关闭 [#230](https://github.com/TuSimple/naive-ui/issues/230)
- 修复 `n-input-number` 至少删除一次输入框内容,则 input-number 不会随 +/- 按钮更改,关闭 [#251](https://github.com/TuSimple/naive-ui/issues/251)

## 2.13.0 (2021-06-21)

Expand Down
6 changes: 1 addition & 5 deletions src/input-number/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// string => string (expected, not implemented)
// string => number (legacy)
export function parse (value: string): number | null {
if (
value === undefined ||
value === null ||
(typeof value === 'string' && value.trim() === '')
) {
if (value === undefined || value === null) {
return null
}
return Number(value)
Expand Down

0 comments on commit d62d4ab

Please sign in to comment.