| 657 | } |
| 658 | |
| 659 | _isValueChanged(inputValue: number) { |
| 660 | const isValueWithCorrectPrecision = this._isValueWithCorrectPrecision; |
| 661 | // Treat values as distinct when modified to match a specific precision (e.g., from 3.4000 to 3.40), |
| 662 | // even if JavaScript sees them as equal, to correctly update valueState based on expected valuePrecision. |
| 663 | const isPrecisionCorrectButValueStateError = isValueWithCorrectPrecision && this.valueState === ValueState.Negative; |
| 664 | |
| 665 | return this.value !== this._previousValue |
| 666 | || this.value !== inputValue |
| 667 | || inputValue === 0 |
| 668 | || !isValueWithCorrectPrecision |
| 669 | || isPrecisionCorrectButValueStateError |
| 670 | || Number.isNaN(inputValue); |
| 671 | } |
| 672 | |
| 673 | _updateValueAndValidate(inputValue: number) { |
| 674 | this.value = inputValue; |