mirror of https://github.com/ElemeFE/element
DatePicker : type="monthrange" 关闭选择面板选择状态不重置的bug
月范围选择面板中选择了一项后,点击其他区域失焦关闭面板,再打开时已选择一项的状态并没有重置pull/22898/head
parent
c345bb453b
commit
f6993fc8c5
|
@ -279,6 +279,7 @@
|
|||
// NOTE: this is a hack to reset {min, max}Date on picker open.
|
||||
// TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
|
||||
// an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
|
||||
if (this.minDate && this.maxDate == null) this.rangeState.selecting = false;
|
||||
this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null;
|
||||
this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue