Skip to content

Commit

Permalink
Fix #5186: InputNumber for multi-char currency (#5194)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 30, 2023
1 parent a421b68 commit 504e725
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ export const InputNumber = React.memo(
const suffixCharIndex = val.search(_suffix.current);

_suffix.current.lastIndex = 0;
const currencyCharIndex = val.search(_currency.current);
let currencyCharIndex = val.search(_currency.current);

if (currencyCharIndex === 0 && prefixChar.current && prefixChar.current.length > 1) {
currencyCharIndex = prefixChar.current.trim().length;
}

_currency.current.lastIndex = 0;

Expand Down

0 comments on commit 504e725

Please sign in to comment.