File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
client/packages/openblocks/src/comps/comps/dateComp Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,6 @@ export type DateCompViewProps = Pick<
158
158
| "secondStep"
159
159
| "viewRef"
160
160
> & {
161
- onPanelChange : ( ) => void ;
162
161
onFocus : ( ) => void ;
163
162
onBlur : ( ) => void ;
164
163
$style : DateTimeStyleType ;
@@ -282,10 +281,9 @@ export const dateRangeControl = (function () {
282
281
) ;
283
282
props . onEvent ( "change" ) ;
284
283
} }
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 ) ;
289
287
} }
290
288
onFocus = { ( ) => props . onEvent ( "focus" ) }
291
289
onBlur = { ( ) => props . onEvent ( "blur" ) }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export interface DateRangeUIViewProps extends DateCompViewProps {
24
24
start : moment . Moment | null ;
25
25
end : moment . Moment | null ;
26
26
onChange : ( start ?: moment . Moment | null , end ?: moment . Moment | null ) => void ;
27
+ onPanelChange : ( value : any , mode : [ string , string ] ) => void ;
27
28
}
28
29
29
30
export const DateRangeUIView = ( props : DateRangeUIViewProps ) => {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const DatePickerStyled = styled(DatePicker)<{ $style: DateTimeStyleType }>`
17
17
export interface DataUIViewProps extends DateCompViewProps {
18
18
value : moment . Moment | null ;
19
19
onChange : ( value : moment . Moment | null ) => void ;
20
+ onPanelChange : ( ) => void ;
20
21
}
21
22
22
23
const DateMobileUIView = React . lazy ( ( ) =>
You can’t perform that action at this time.
0 commit comments