Skip to content

Commit

Permalink
fix(pasttimepicker): fix onclear
Browse files Browse the repository at this point in the history
  • Loading branch information
YanHui committed Jul 4, 2024
1 parent 0ab83ab commit 9e7fc5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},

//eslint -----settings start-----
Expand Down
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, true);
setControlledVisible(false);
onSelect?.(currentValue);
};
Expand Down

0 comments on commit 9e7fc5c

Please sign in to comment.