From e0b93f8e52c4ea480130cd04435ab7080105ff16 Mon Sep 17 00:00:00 2001 From: melloware Date: Mon, 30 Oct 2023 08:23:59 -0400 Subject: [PATCH] Fix #5186: InputNumber for multi-char currency --- 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;