DatePicker : type="monthrange" 关闭选择面板选择状态不重置的bug

月范围选择面板中选择了一项后,点击其他区域失焦关闭面板,再打开时已选择一项的状态并没有重置
pull/22898/head
leekbillow 2024-06-18 10:56:01 +08:00 committed by GitHub
parent c345bb453b
commit f6993fc8c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}