Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datepicker): 优化关闭浮层后重置默认选中区域 #2371

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/date-picker/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const DateRangePicker = forwardRef<HTMLDivElement, DateRangePickerProps>((origin
setMonth(value.map((v: string) => parseToDayjs(v, format).month()));
}
} else {
setActiveIndex(0);
setIsHoverCell(false);
setIsFirstValueSelected(false);
setInputValue(formatDate(value || [], { format }));
Expand Down
1 change: 1 addition & 0 deletions src/date-picker/hooks/useRange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default function useRange(props: TdDateRangePickerProps) {

// activeIndex 变化自动 focus 对应输入框
useEffect(() => {
if (!popupVisible) return;
if (!isMountedRef.current) {
isMountedRef.current = true;
return;
Expand Down
Loading