Skip to content

Commit

Permalink
fix(pastTimePicker): fixempty quickmode confirm&cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
YanHui committed Dec 22, 2023
1 parent b9d9255 commit b106354
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 @@ -49,7 +50,8 @@ function QuickPicker({
};

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

useEffect(() => {
Expand Down Expand Up @@ -89,7 +91,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 @@ -87,6 +87,7 @@ export interface QuickPickerProps extends PickerProps {
*/
optionsFilter?: (o: Option) => boolean;
NotAvailableToday: boolean;
onCancel?: () => void;
}

export interface InnerRangePanelProps {
Expand Down

0 comments on commit b106354

Please sign in to comment.