Skip to content

Commit

Permalink
Fixed #1912 - InputNumber with required attribute doesn't behave the …
Browse files Browse the repository at this point in the history
…same as html <input required> element.
  • Loading branch information
mertsincan committed Mar 29, 2021
1 parent 9a5d4f1 commit 44c0a5e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,13 @@ export class InputNumber extends Component {
}

updateInputValue(newValue) {
this.inputEl.value = this.formatValue(newValue);
this.inputEl.setAttribute('aria-valuenow', newValue);
const value = this.inputEl.value;
const formattedValue = this.formatValue(newValue);

if (value !== formattedValue) {
this.inputEl.value = formattedValue;
this.inputEl.setAttribute('aria-valuenow', newValue);
}
}

updateModel(event, value) {
Expand Down

0 comments on commit 44c0a5e

Please sign in to comment.