MCPcopy Create free account
hub / github.com/UI5/webcomponents / _isValueChanged

Method _isValueChanged

packages/main/src/StepInput.ts:659–671  ·  view source on GitHub ↗
(inputValue: number)

Source from the content-addressed store, hash-verified

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;

Callers 1

_onInputChangeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected