diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0cc071de7f..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, - "source.fixAll.stylelint": true - }, - - //eslint -----settings start----- - - "eslint.packageManager": "yarn", - "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], - - //eslint -----settings end----- - - //prettier -----settings start----- - - "prettier.useEditorConfig": false, - "prettier.requireConfig": true, - - //prettier -----settings end----- - //pretier -----settings end----- - - //stylelint -----settings start----- - - // 防止编辑器内置linter与插件冲突设置 - "css.validate": false, - "less.validate": false, - "scss.validate": false, - "stylelint.enable": true, - "stylelint.packageManager": "yarn", - "stylelint.validate": [ - "css", - "html", - "less", - "markdown", - "postcss", - "sass", - "scss", - "source.css.styled", - "styled-css", - "sugarss", - "svelte" - ], - "typescript.tsdk": "node_modules/typescript/lib" - - //stylelint -----settings end----- -} diff --git a/src/past-time-picker/PastTimePicker.tsx b/src/past-time-picker/PastTimePicker.tsx index bb4a869988..b0a5e4c3d7 100644 --- a/src/past-time-picker/PastTimePicker.tsx +++ b/src/past-time-picker/PastTimePicker.tsx @@ -83,7 +83,7 @@ const PastTimePicker = (props: PastTimePickerProps) => { const [controlledVisible, setControlledVisible] = useControlledState(popoverVisible, false); - const [timeRange, setTimeRange] = useControlledState(value, undefined); + const [timeRange, setTimeRange] = useControlledState(value, undefined); const QUICK_MAPPING = { 'day:1,0': todayText, @@ -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); };