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

Method _updateValueState

packages/main/src/StepInput.ts:534–551  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

532 }
533
534 _updateValueState() {
535 const isWithinRange = (this.min === undefined || this._parseNumber(this.input.value) >= this.min)
536 && (this.max === undefined || this._parseNumber(this.input.value) <= this.max);
537 const isValueWithCorrectPrecision = this._isValueWithCorrectPrecision;
538 const previousValueState = this.valueState;
539 const isValid = isWithinRange && isValueWithCorrectPrecision;
540
541 this.valueState = isValid ? ValueState.None : ValueState.Negative;
542
543 const eventPrevented = !this.fireDecoratorEvent("value-state-change", {
544 valueState: this.valueState,
545 valid: isValid,
546 });
547
548 if (eventPrevented) {
549 this.valueState = previousValueState;
550 }
551 }
552
553 _preciseValue(value: number) {
554 const pow = 10 ** this.valuePrecision;

Callers 1

_validateMethod · 0.95

Calls 1

_parseNumberMethod · 0.95

Tested by

no test coverage detected