mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 04:48:32 +08:00
Merge pull request #3849 from 2betop/fix-input-date
fix: 修复 inputDate 显示值不同步的问题
This commit is contained in:
commit
f5741401e3
@ -371,18 +371,7 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
|
||||
value: normalizeValue(props.value, props.format)
|
||||
};
|
||||
|
||||
if (
|
||||
typeof prevValue === 'undefined' || // initApi 的情况
|
||||
(typeof prevValue === 'string' && // 公式的情况
|
||||
(prevValue.startsWith('+') ||
|
||||
prevValue.startsWith('-') ||
|
||||
prevValue.startsWith('$')))
|
||||
) {
|
||||
newState.inputValue =
|
||||
normalizeValue(this.props.value, this.props.format)?.format(
|
||||
this.props.inputFormat
|
||||
) || '';
|
||||
}
|
||||
newState.inputValue = newState.value.format(this.props.inputFormat) || '';
|
||||
|
||||
this.setState(newState);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user