close picker on pressing enter on time fields
This commit is contained in:
parent
45bc4b71f2
commit
75a3e9262a
|
|
@ -182,6 +182,13 @@ function DatePickerComponent(props: DatePickerComponentProps) {
|
|||
setDatePickerVisibility(nextOpenState);
|
||||
}
|
||||
|
||||
function handleTimePickerKeydown(e: React.KeyboardEvent) {
|
||||
if (e.key === "Enter") {
|
||||
setDatePickerVisibility(false);
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledDateInput
|
||||
className={Classes.DATE_PICKER_OVARLAY}
|
||||
|
|
@ -205,6 +212,9 @@ function DatePickerComponent(props: DatePickerComponentProps) {
|
|||
isOpen: isDatePickerVisible,
|
||||
}}
|
||||
showActionsBar={props.showActionsBar}
|
||||
timePickerProps={{
|
||||
onKeyDown: handleTimePickerKeydown,
|
||||
}}
|
||||
timePrecision={props.timePrecision}
|
||||
value={props.value}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user