diff --git a/src/legacy/ui/public/query_bar/components/query_bar.tsx b/src/legacy/ui/public/query_bar/components/query_bar.tsx index d7d52881567ed..508f7980eda9e 100644 --- a/src/legacy/ui/public/query_bar/components/query_bar.tsx +++ b/src/legacy/ui/public/query_bar/components/query_bar.tsx @@ -380,16 +380,21 @@ export class QueryBarUI extends Component { start, end, isInvalid, + isQuickSelection, }: { start: string; end: string; isInvalid: boolean; + isQuickSelection: boolean; }) => { - this.setState({ - dateRangeFrom: start, - dateRangeTo: end, - isDateRangeInvalid: isInvalid, - }); + this.setState( + { + dateRangeFrom: start, + dateRangeTo: end, + isDateRangeInvalid: isInvalid, + }, + () => isQuickSelection && this.onSubmit() + ); }; public onKeyUp = (event: React.KeyboardEvent) => {