Textarea 值为 null 时显示为空

This commit is contained in:
liaoxuezhi 2019-08-19 12:01:33 +08:00
parent 390653b3e5
commit 374c94d08a

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}