From 4c5d56282aa2c16348682ac7629f1cc62432270d Mon Sep 17 00:00:00 2001 From: Cesar S Date: Thu, 23 Nov 2023 21:48:30 +0000 Subject: [PATCH] fix: pass currentTarget to onFocus --- src/number_format_base.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/number_format_base.tsx b/src/number_format_base.tsx index f8d1e52b..da8808da 100644 --- a/src/number_format_base.tsx +++ b/src/number_format_base.tsx @@ -383,6 +383,7 @@ export default function NumberFormatBase( if (e.persist) e.persist(); const el = e.target; + const currentTarget = e.currentTarget; focusedElm.current = el; timeout.current.focusTimeout = setTimeout(() => { @@ -398,7 +399,7 @@ export default function NumberFormatBase( setPatchedCaretPosition(el, caretPosition, value); } - onFocus(e); + onFocus({ ...e, currentTarget }); }, 0); };