toggle on pressing enter

This commit is contained in:
Ankur Singhal 2022-04-01 04:37:12 +05:30
parent d7db15cb60
commit 102a7f3c04

View File

@ -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") {