From 504e72587f2bfc4654ed7e84e821bd12d663c29e Mon Sep 17 00:00:00 2001 From: Melloware Date: Mon, 30 Oct 2023 08:24:57 -0400 Subject: [PATCH] Fix #5186: InputNumber for multi-char currency (#5194) --- components/lib/inputnumber/InputNumber.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index 180702c1df..941c25fa83 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -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;