Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96f1dfe

Browse files
Esieveggbond268
authored andcommitted
fix: date range data clear problem
(cherry picked from commit 2ceeb25770c41810ceca62e90eb9d70314194c21)
1 parent 3a49b58 commit 96f1dfe

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

client/packages/openblocks/src/comps/comps/dateComp/dateComp.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ export type DateCompViewProps = Pick<
158158
| "secondStep"
159159
| "viewRef"
160160
> & {
161-
onPanelChange: () => void;
162161
onFocus: () => void;
163162
onBlur: () => void;
164163
$style: DateTimeStyleType;
@@ -282,10 +281,9 @@ export const dateRangeControl = (function () {
282281
);
283282
props.onEvent("change");
284283
}}
285-
onPanelChange={() => {
286-
// mode[0] !== "date" && handleDateChange("", props.start.onChange, noop);
287-
handleDateChange("", props.start.onChange, noop);
288-
handleDateChange("", props.end.onChange, noop);
284+
onPanelChange={(_, mode) => {
285+
mode[0] !== "date" && handleDateChange("", props.start.onChange, noop);
286+
mode[1] !== "date" && handleDateChange("", props.end.onChange, noop);
289287
}}
290288
onFocus={() => props.onEvent("focus")}
291289
onBlur={() => props.onEvent("blur")}

client/packages/openblocks/src/comps/comps/dateComp/dateRangeUIView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface DateRangeUIViewProps extends DateCompViewProps {
2424
start: moment.Moment | null;
2525
end: moment.Moment | null;
2626
onChange: (start?: moment.Moment | null, end?: moment.Moment | null) => void;
27+
onPanelChange: (value: any, mode: [string, string]) => void;
2728
}
2829

2930
export const DateRangeUIView = (props: DateRangeUIViewProps) => {

client/packages/openblocks/src/comps/comps/dateComp/dateUIView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const DatePickerStyled = styled(DatePicker)<{ $style: DateTimeStyleType }>`
1717
export interface DataUIViewProps extends DateCompViewProps {
1818
value: moment.Moment | null;
1919
onChange: (value: moment.Moment | null) => void;
20+
onPanelChange: () => void;
2021
}
2122

2223
const DateMobileUIView = React.lazy(() =>

0 commit comments

Comments
 (0)