Skip to content

Commit

Permalink
fix: setCaretTimeout check
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 ad85c02 commit 4450eea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/number_format_base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function NumberFormatBase<BaseType = InputAttributes>(
setCaretPosition(el, caretPos);

timeout.current.setCaretTimeout = setTimeout(() => {
if (el.value === currentValue && el.selectionStart !== el.selectionEnd) {
if (el.value === currentValue && el.selectionStart !== caretPos) {
setCaretPosition(el, caretPos);
}
}, 0);
Expand Down

0 comments on commit 4450eea

Please sign in to comment.