Skip to content

Commit

Permalink
fix(pasttimepicker): fix onclear (#2230)
Browse files Browse the repository at this point in the history
* fix(pasttimepicker): fix onclear

* fix(pasttimepicker): fix onclear

* fix(pasttimepicker): fix onclear

* fix(pasttimepicker): fix onclear

* fix(pasttimepicker): fix onclear

---------

Co-authored-by: YanHui <liubai@startdt.com>
  • Loading branch information
hiker90 and YanHui authored Jul 4, 2024
1 parent 1a11b45 commit 072c365
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 53 deletions.
51 changes: 0 additions & 51 deletions .vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/past-time-picker/PastTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const PastTimePicker = (props: PastTimePickerProps) => {

const [controlledVisible, setControlledVisible] = useControlledState(popoverVisible, false);

const [timeRange, setTimeRange] = useControlledState<string | undefined | null>(value, undefined);
const [timeRange, setTimeRange] = useControlledState<string | undefined>(value, undefined);

const QUICK_MAPPING = {
'day:1,0': todayText,
Expand Down Expand Up @@ -171,7 +171,7 @@ const PastTimePicker = (props: PastTimePickerProps) => {
};

const handleOnSelect = (currentValue: string | null) => {
setTimeRange(currentValue, true);
setTimeRange((!currentValue ? undefined : currentValue) as string | undefined, true);
setControlledVisible(false);
onSelect?.(currentValue);
};
Expand Down

0 comments on commit 072c365

Please sign in to comment.