Textarea 值为 null 时显示为空

This commit is contained in:
liaoxuezhi 2019-08-19 12:01:33 +08:00
parent 3b7d8e6e59
commit b07e424425

View File

@ -91,7 +91,7 @@ export default class TextAreaControl extends React.Component<TextAreaProps, any>
disabled={disabled}
type={type}
className={cx(`${ns}TextareaControl`, className)}
value={typeof value === 'undefined' ? '' : typeof value === 'string' ? value : JSON.stringify(value)}
value={typeof value === 'undefined' || value === null ? '' : typeof value === 'string' ? value : JSON.stringify(value)}
placeholder={placeholder}
minRows={minRows}
maxRows={maxRows}