Skip to content

Commit

Permalink
fix(pastTimePicker): fixempty quickmode confirm&cancel (#2219)
Browse files Browse the repository at this point in the history
* fix(pastTimePicker): fixempty quickmode confirm&cancel

* fix

---------

Co-authored-by: YanHui <liubai@startdt.com>
  • Loading branch information
hiker90 and YanHui authored Dec 21, 2023
1 parent bc4727a commit bb83aaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/static-past-time-picker/QuickPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function QuickPicker({
options: optionsParams,
optionsFilter,
onSelect,
onCancel,
timeRange,
experimental,
NotAvailableToday,
Expand Down Expand Up @@ -53,7 +54,8 @@ function QuickPicker({
};

const handleCancel = () => {
onSelect(timeRange as string);
// onSelect(timeRange as string);
onCancel?.();
};

useEffect(() => {
Expand Down Expand Up @@ -93,7 +95,7 @@ function QuickPicker({
<Button type="secondary" size="small" onClick={handleCancel}>
{closeText}
</Button>
<Button type="primary" size="small" onClick={handleOk}>
<Button type="primary" size="small" onClick={handleOk} disabled={!currentValue}>
{okText}
</Button>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/static-past-time-picker/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export interface QuickPickerProps extends PickerProps {
*/
optionsFilter?: (o: Option) => boolean;
NotAvailableToday?: boolean;
onCancel?: () => void;
}

export interface InnerRangePanelProps {
Expand Down

0 comments on commit bb83aaa

Please sign in to comment.