Skip to content

Commit

Permalink
Remove onClear on date range picker inputs (#110035) (#110189)
Browse files Browse the repository at this point in the history
fixes /issues/108864

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Ashokaditya <[email protected]>
  • Loading branch information
kibanamachine and ashokaditya authored Aug 26, 2021
1 parent 9effd6b commit 7f15ecb
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@ export const DateRangePicker = memo(() => {
getActivityLogDataPaging
);

const onClear = useCallback(
({ clearStart = false, clearEnd = false }: { clearStart?: boolean; clearEnd?: boolean }) => {
dispatch({
type: 'endpointDetailsActivityLogUpdatePaging',
payload: {
disabled: false,
page,
pageSize,
startDate: clearStart ? undefined : startDate,
endDate: clearEnd ? undefined : endDate,
},
});
},
[dispatch, endDate, startDate, page, pageSize]
);

const onChangeStartDate = useCallback(
(date) => {
dispatch({
Expand Down Expand Up @@ -95,7 +79,6 @@ export const DateRangePicker = memo(() => {
endDate={endDate ? moment(endDate) : undefined}
isInvalid={isInvalidDateRange}
onChange={onChangeStartDate}
onClear={() => onClear({ clearStart: true })}
placeholderText={i18.ACTIVITY_LOG.datePicker.startDate}
selected={startDate ? moment(startDate) : undefined}
showTimeSelect
Expand All @@ -108,7 +91,6 @@ export const DateRangePicker = memo(() => {
endDate={endDate ? moment(endDate) : undefined}
isInvalid={isInvalidDateRange}
onChange={onChangeEndDate}
onClear={() => onClear({ clearEnd: true })}
placeholderText={i18.ACTIVITY_LOG.datePicker.endDate}
selected={endDate ? moment(endDate) : undefined}
showTimeSelect
Expand Down

0 comments on commit 7f15ecb

Please sign in to comment.