fix: miss merge logic

This commit is contained in:
zombiej 2020-12-26 23:59:36 +08:00
parent 99d5451dba
commit a10a30ff60

View File

@ -96,10 +96,12 @@ const TextArea = React.forwardRef<TextAreaRef, TextAreaProps>(
/>
);
const val = fixControlledValue(value) as string;
let val = fixControlledValue(value) as string;
// Max length value
const hasMaxLength = Number(maxLength) > 0;
// fix #27612 将value转为数组进行截取解决 '😂'.length === 2 等emoji表情导致的截取乱码的问题
val = hasMaxLength ? [...val].slice(0, maxLength).join('') : val;
// TextArea
const textareaNode = (