fix: handle Escape in date/datetime pickers and remove ValidationStep any (#18107)
## Summary - **DatePicker / DateTimePicker:** Call onEscape when user presses Escape (fixes FIXME). - **FormDateFieldInput:** Revert input/picker on Escape; handle Escape in text input. - **FormDateTimeFieldInput:** Remove FIXME. - **ValidationStep:** Replace any with typed callback. --------- Co-authored-by: Thomas Trompette <thomas.trompette@sfr.fr>
This commit is contained in:
-2
@@ -200,8 +200,6 @@ export const FormDateFieldInput = ({
|
||||
const handlePickerEnter = () => {};
|
||||
|
||||
const handlePickerEscape = () => {
|
||||
// FIXME: Escape key is not handled properly by the underlying DateInput component. We need to solve that.
|
||||
|
||||
setDraftValue({
|
||||
type: 'static',
|
||||
value: draftValue.value,
|
||||
|
||||
-2
@@ -141,8 +141,6 @@ export const FormDateTimeFieldInput = ({
|
||||
const handlePickerEnter = () => {};
|
||||
|
||||
const handlePickerEscape = () => {
|
||||
// FIXME: Escape key is not handled properly by the underlying DateInput component. We need to solve that.
|
||||
|
||||
setDraftValue({
|
||||
type: 'static',
|
||||
value: draftValue.value,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { styled } from '@linaria/react';
|
||||
import { Suspense, lazy, useContext, type ComponentType } from 'react';
|
||||
import { lazy, Suspense, useContext, type ComponentType } from 'react';
|
||||
import type { ReactDatePickerProps as ReactDatePickerLibProps } from 'react-datepicker';
|
||||
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import { getHighlightedDates } from '@/ui/input/components/internal/date/utils/g
|
||||
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
|
||||
import { styled } from '@linaria/react';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { Suspense, lazy, useContext, type ComponentType } from 'react';
|
||||
import { lazy, Suspense, useContext, type ComponentType } from 'react';
|
||||
import type { ReactDatePickerProps as ReactDatePickerLibProps } from 'react-datepicker';
|
||||
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user