Skip to content

Commit

Permalink
fix: value 为空直接 return (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: crazyair <[email protected]>
  • Loading branch information
crazyair and crazyair authored May 20, 2020
1 parent ea707ee commit 9882bf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/yforms/src/YForm/component/Money.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class InputMoney extends React.PureComponent<YMoneyProps> {
const { onChange } = this.props;
if (onChange) {
const { value } = e.target;
if (value === undefined || value === '') {
return value;
}
const _number = parseFloat(value);
if (Number.isNaN(_number)) {
return onChange(0);
Expand Down

1 comment on commit 9882bf3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for website ready!

Built with commit 9882bf3

https://father-doc-yform-buxzgk97q.now.sh

Please sign in to comment.