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

Method _spinValue

packages/main/src/StepInput.ts:805–824  ·  view source on GitHub ↗

* Called when the increment or decrement button is pressed and held to set new value. * @private * @param increment - is this the increment button or not so the values should be spin accordingly up or down * @param resetVariables - whether to reset the spin-related variables or not

(increment: boolean, resetVariables = false)

Source from the content-addressed store, hash-verified

803 * @param resetVariables - whether to reset the spin-related variables or not
804 */
805 _spinValue(increment: boolean, resetVariables = false) {
806 if (resetVariables) {
807 this._waitTimeout = INITIAL_WAIT_TIMEOUT;
808 this._speed = INITIAL_SPEED;
809 this._btnDown = true;
810 }
811 this._spinTimeoutId = setTimeout(() => {
812 if (this._btnDown) {
813 this._spinStarted = true;
814 this._modifyValue(increment ? this.step : -this.step);
815 this._setButtonState();
816 if ((!this._incIconDisabled && increment) || (!this._decIconDisabled && !increment)) {
817 this._spinValue(increment);
818 } else {
819 this._resetSpin();
820 this._fireChangeEvent();
821 }
822 }
823 }, this._calcWaitTimeout());
824 }
825
826 /**
827 * Resets spin process

Callers 2

_decSpinMethod · 0.95
_incSpinMethod · 0.95

Calls 5

_modifyValueMethod · 0.95
_setButtonStateMethod · 0.95
_resetSpinMethod · 0.95
_fireChangeEventMethod · 0.95
_calcWaitTimeoutMethod · 0.95

Tested by

no test coverage detected