Skip to content

Commit

Permalink
fix(ui5-input): delete whole value of ui5-input with type number when… (
Browse files Browse the repository at this point in the history
#4760)

* fix(ui5-input): delete whole value of ui5-input with type number when selected

* adjust tests

* test fix

* test issue

* unstable test removed
  • Loading branch information
niyap authored Feb 17, 2022
1 parent f2fd6fb commit 0aa9979
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,10 @@ class Input extends UI5Element {

// Perform manual handling in case of floating number
// and if the user did not select the entire input value
if (this._selectedText.indexOf(",") > -1) {
this._selectedText = this._selectedText.replace(",", ".");
}

if (rgxFloat.test(this.value) && this._selectedText !== this.value) {
const newValue = this.removeFractionalPart(this.value);

Expand Down

0 comments on commit 0aa9979

Please sign in to comment.