Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/components/date-picker/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ export default defineComponent({
}

// 首次点击不关闭、确保两端都有有效值并且无时间选择器时点击后自动关闭
if (!isFirstValueSelected.value || !activeIndex.value) {
if (!isFirstValueSelected.value) {
let nextIndex = notValidIndex;
if (nextIndex === -1) nextIndex = activeIndex.value ? 0 : 1;
activeIndex.value = nextIndex as 0 | 1;
isFirstValueSelected.value = !!nextValue[0];
isFirstValueSelected.value = nextValue.some((v) => !!v);
} else {
popupVisible.value = false;
}
Expand Down Expand Up @@ -294,11 +294,11 @@ export default defineComponent({
const notValidIndex = nextValue.findIndex((v) => !v || !isValidDate(v, formatRef.value.format));

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