From e03490c9e53372b3e052a5b1c6204dad300ea7dc Mon Sep 17 00:00:00 2001 From: joepuzzo Date: Thu, 30 May 2024 07:41:21 -0700 Subject: [PATCH] fixed issue where formatting in react native with number formatter would not allow user to type a decimal --- CHANGELOG.md | 6 ++++++ src/utils.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccda8e22..d0e86590 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.60.2 ( May 30th, 2024) + +### Fixed + +- Issue where formatting in react native with number formatter would not allow user to type a decimal "2." + ## 4.60.1 ( May 28th, 2024) ### Fixed diff --git a/src/utils.js b/src/utils.js index c5dca542..6c4cc8f4 100644 --- a/src/utils.js +++ b/src/utils.js @@ -721,7 +721,10 @@ export const informedFormatter = (val, frmtr, old, full) => { // Special case, we want to diable keeping suffix on backspace in react native if ( typeof navigator !== 'undefined' && - navigator.product === 'ReactNative' + navigator.product === 'ReactNative' && + value && + old && + value.length < old.length ) { // I'm in react-native formattedString = formattedString.slice(0, suffixStart);