Skip to content

Commit

Permalink
fix: pass currentTarget to onFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
csantos1113 authored and s-yadav committed Feb 25, 2024
1 parent e2179f9 commit ad85c02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/number_format_base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ export default function NumberFormatBase<BaseType = InputAttributes>(
if (e.persist) e.persist();

const el = e.target;
const currentTarget = e.currentTarget;
focusedElm.current = el;

timeout.current.focusTimeout = setTimeout(() => {
Expand All @@ -398,7 +399,7 @@ export default function NumberFormatBase<BaseType = InputAttributes>(
setPatchedCaretPosition(el, caretPosition, value);
}

onFocus(e);
onFocus({ ...e, currentTarget });
}, 0);
};

Expand Down

0 comments on commit ad85c02

Please sign in to comment.