Skip to content

Commit

Permalink
fix(ui5-step-input): firing step input once when value is deleted (#3474
Browse files Browse the repository at this point in the history
)

fixes: #3457
  • Loading branch information
tsanislavgatev authored and ilhan007 committed Jul 2, 2021
1 parent ec4273d commit 2bcb78b
Show file tree
Hide file tree
Showing 2 changed files with 456 additions and 451 deletions.
9 changes: 7 additions & 2 deletions packages/main/src/StepInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,10 @@ class StepInput extends UI5Element {
}

_fireChangeEvent() {
this._previousValue = this.value;
this.fireEvent("change", { value: this.value });
if (this._previousValue !== this.value) {
this._previousValue = this.value;
this.fireEvent("change", { value: this.value });
}
}

/**
Expand Down Expand Up @@ -543,6 +545,9 @@ class StepInput extends UI5Element {
}

_onInputChange(event) {
if (this.input.value === "") {
this.input.value = this.min || 0;
}
const inputValue = this._preciseValue(parseFloat(this.input.value));
if (this.value !== this._previousValue || this.value !== inputValue) {
this.value = inputValue;
Expand Down
Loading

0 comments on commit 2bcb78b

Please sign in to comment.