toggle on pressing enter
This commit is contained in:
parent
d7db15cb60
commit
102a7f3c04
|
|
@ -132,7 +132,7 @@ function DatePickerComponent(props: DatePickerComponentProps) {
|
||||||
function handleKeydown(e: KeyboardEvent) {
|
function handleKeydown(e: KeyboardEvent) {
|
||||||
if (document.activeElement === inputRef.current) {
|
if (document.activeElement === inputRef.current) {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
setDatePickerVisibility(true);
|
setDatePickerVisibility((value) => !value);
|
||||||
} else if (e.key === "Escape") {
|
} else if (e.key === "Escape") {
|
||||||
setDatePickerVisibility(false);
|
setDatePickerVisibility(false);
|
||||||
} else if (e.key === "Tab") {
|
} else if (e.key === "Tab") {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user