Skip to content

Commit

Permalink
feat(datepicker): 优化关闭浮层后重置默认选中区域 (Tencent#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
honkinglin authored and methodchen committed Aug 25, 2023
1 parent 157f25f commit 00b2f77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/date-picker/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default defineComponent({
if (month.value.length === 1) month.value = [month.value[0], Math.min(month.value[0] + 1, 11)];
}
} else {
activeIndex.value = 0;
isHoverCell.value = false;
isFirstValueSelected.value = false;
inputValue.value = formatDate(value.value, {
Expand Down
1 change: 1 addition & 0 deletions src/date-picker/hooks/useRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default function useRange(props: TdDateRangePickerProps, { emit }: any) {
isMountedRef.value = true;
return;
}
if (!popupVisible.value) return;
const indexMap = { 0: 'first', 1: 'second' };
inputRef.value?.focus?.({ position: indexMap[index] });
});
Expand Down

0 comments on commit 00b2f77

Please sign in to comment.