diff --git a/public/app/core/components/TimePicker/TimePickerWithHistory.tsx b/public/app/core/components/TimePicker/TimePickerWithHistory.tsx index c0ff897f4afd3..6752f3735be22 100644 --- a/public/app/core/components/TimePicker/TimePickerWithHistory.tsx +++ b/public/app/core/components/TimePicker/TimePickerWithHistory.tsx @@ -47,12 +47,11 @@ export const Picker: FC = ({ values, onSaveToStore, pickerProps }) } onAppendToHistory(fnGlobalTimeRange, values, onSaveToStore); pickerProps.onChange(fnGlobalTimeRange); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [fnGlobalTimeRange, onSaveToStore, pickerProps, values]); return ( { dispatch( @@ -60,8 +59,6 @@ export const Picker: FC = ({ values, onSaveToStore, pickerProps }) fnGlobalTimeRange: value, }) ); - onAppendToHistory(value, values, onSaveToStore); - pickerProps.onChange(value); }} fnText={} />