Skip to content

Commit

Permalink
fix(datepicker): 修复第二次点击面板关闭异常问题 (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
honkinglin authored Apr 27, 2023
1 parent ce1c01f commit 2c25dd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/date-picker/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ export default defineComponent({
}

// 首次点击不关闭、确保两端都有有效值并且无时间选择器时点击后自动关闭
if (!isFirstValueSelected.value) {
if (nextValue.length === 1 || !isFirstValueSelected.value) {
let nextIndex = notValidIndex;
if (nextIndex === -1) nextIndex = activeIndex.value ? 0 : 1;
activeIndex.value = nextIndex;
isFirstValueSelected.value = true;
} else {
} else if (nextValue.length === 2) {
popupVisible.value = false;
}
}
Expand Down

0 comments on commit 2c25dd1

Please sign in to comment.