Skip to content

Commit eb6479d

Browse files
committed
Merge branch 'develop' into feature/ddw-620-extend-react-polymorph-dropdown-to-include-search-feature
2 parents a661d8d + 832af7b commit eb6479d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ vNext
1414

1515
### Fixes
1616

17+
- Fixed an issue related to Numeric Input when entering numbers after having selected the decimal separator ([PR 167](https://github.com/input-output-hk/react-polymorph/pull/167))
1718
- Fixed issues related to controlled/uncontrolled Tippy state ([PR 160](https://github.com/input-output-hk/react-polymorph/pull/160))
1819
- Fixed `NumericInput` to support DEBUG mode ([PR 159](https://github.com/input-output-hk/react-polymorph/pull/159))
1920

source/components/NumericInput.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,20 @@ class NumericInputBase extends Component<NumericInputProps, State> {
220220
newCaretPosition = newValue.indexOf(decimalSeparator) + 1;
221221
}
222222

223+
// Case: Decimal separator was replaced with a number
224+
if (
225+
value != null &&
226+
hadDecimalSeparatorBefore &&
227+
newNumberOfDecimalSeparators === 0 &&
228+
isInsert
229+
) {
230+
return {
231+
caretPosition: changedCaretPosition - 1,
232+
fallbackInputValue,
233+
value,
234+
};
235+
}
236+
223237
/**
224238
* ========= PROCESS CLEANED INPUT =============
225239
*/

0 commit comments

Comments
 (0)