|
|
@@ -994,26 +994,15 @@ export default class DatePickerFoundation extends BaseFoundation<DatePickerAdapt
|
|
|
* 受控时如果输入不完整,由于没有触发 notifyChange
|
|
|
* 需要组件内更新一下输入框的值,否则会出现选了一个日期但是输入框没有回显日期的问题 #1357
|
|
|
*/
|
|
|
- if (!this._adapter.needConfirm() || fromPreset) {
|
|
|
- if (isRangeTypeAndInputIncomplete) {
|
|
|
- // do not change value when selected value is incomplete
|
|
|
- this._adapter.updateInputValue(inputValue);
|
|
|
- this._adapter.updateInsetInputValue(insetInputValue);
|
|
|
- return;
|
|
|
- } else {
|
|
|
- if (!controlled || fromPreset) {
|
|
|
- this._updateValueAndInput(dates, true, inputValue);
|
|
|
- this._adapter.updateInsetInputValue(insetInputValue);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (!controlled && this._adapter.needConfirm()) {
|
|
|
- // select date only change inputValue when needConfirm is true
|
|
|
+ if (isRangeTypeAndInputIncomplete) {
|
|
|
+ // do not change value when selected value is incomplete
|
|
|
this._adapter.updateInputValue(inputValue);
|
|
|
this._adapter.updateInsetInputValue(insetInputValue);
|
|
|
- // if inputValue is not complete, don't notifyChange
|
|
|
- if (isRangeTypeAndInputIncomplete) {
|
|
|
- return;
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ if (!controlled || fromPreset) {
|
|
|
+ this._updateValueAndInput(dates, true, inputValue);
|
|
|
+ this._adapter.updateInsetInputValue(insetInputValue);
|
|
|
}
|
|
|
}
|
|
|
if (!isEqual(value, stateValue)) {
|