dx-platform
dx-platform copied to clipboard
react-kit: DateInput. Fix mouse event callbacks signature
We have wrong types for the following DateInput props: onFocus
, onBlur
, onMouseEnter
and onMouseLeave
. Currently, their inferred type is (((event: React.MouseEvent<HTMLElement>) => void) & (() => void)) | undefined
which doesn't allow us to pass a callback that requires MouseEvent (because of () => void
part).
The reason is that this props declared twice: on the TFullInputProps
(with correct signature) and on TDateInputOwnProps
itself (wrong one). The solution here is to simply remove these props from TDateInputOwnProps
and let them be inferred from TFullInputProps
.
Be careful because these handlers may be throttled and this may conflict with event pooling done by React under the hood.