From 102a7f3c047fe4fd76d1c3b74264c5a7a2a4a030 Mon Sep 17 00:00:00 2001 From: Ankur Singhal Date: Fri, 1 Apr 2022 04:37:12 +0530 Subject: [PATCH] toggle on pressing enter --- app/client/src/components/ads/DatePickerComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/src/components/ads/DatePickerComponent.tsx b/app/client/src/components/ads/DatePickerComponent.tsx index fac3c1be19..9512c52ffc 100644 --- a/app/client/src/components/ads/DatePickerComponent.tsx +++ b/app/client/src/components/ads/DatePickerComponent.tsx @@ -132,7 +132,7 @@ function DatePickerComponent(props: DatePickerComponentProps) { function handleKeydown(e: KeyboardEvent) { if (document.activeElement === inputRef.current) { if (e.key === "Enter") { - setDatePickerVisibility(true); + setDatePickerVisibility((value) => !value); } else if (e.key === "Escape") { setDatePickerVisibility(false); } else if (e.key === "Tab") {