Skip to content

Commit

Permalink
fixed issue where formatting in react native with number formatter wo…
Browse files Browse the repository at this point in the history
…uld not allow user to type a decimal
  • Loading branch information
joepuzzo committed May 30, 2024
1 parent 01c8627 commit e03490c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e03490c

Please sign in to comment.