Skip to content

Commit

Permalink
fix: 非 undefined 的 falsely 值无法传递给子组件 (#1312)
Browse files Browse the repository at this point in the history
Co-authored-by: qnnp <[email protected]>
  • Loading branch information
qnnp-me and qnnp authored Aug 16, 2023
1 parent 4d0387e commit fd1af21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/packages/formitem/formitem.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export class FormItem extends React.Component<
const controlled = {
...children.props,
[this.props.valuePropName || 'value']:
getFieldValue(name) || this.props.initialValue,
getFieldValue(name) === undefined
? this.props.initialValue
: getFieldValue(name),
[this.props.trigger || 'onChange']: (...args: any) => {
// args [a, b]
const originOnChange = (children as any).props[
Expand Down

0 comments on commit fd1af21

Please sign in to comment.