MCPcopy
hub / github.com/autoNumeric/autoNumeric / upDownArrowAction

Method upDownArrowAction

src/AutoNumeric.js:7646–7663  ·  view source on GitHub ↗

* Handler for up and down arrow keys * Increment or decrement the element value according to the `upDownStep` option chosen * * @param {KeyboardEvent} e

(e)

Source from the content-addressed store, hash-verified

7644 * @param {KeyboardEvent} e
7645 */
7646 upDownArrowAction(e) {
7647 if (this.formulaMode ||
7648 this.settings.readOnly || this.domElement.readOnly || this.domElement.disabled) {
7649 return;
7650 }
7651
7652 let isUp = false;
7653 let isDown = false;
7654 if (this.eventKey === AutoNumericEnum.keyName.UpArrow) {
7655 isUp = true;
7656 } else if (this.eventKey === AutoNumericEnum.keyName.DownArrow) {
7657 isDown = true;
7658 } else {
7659 AutoNumericHelper.throwError('Something has gone wrong since neither an Up or Down arrow key is detected, but the function was still called!');
7660 }
7661
7662 this._wheelAndUpDownActions(e, isUp, isDown, this.settings.upDownStep);
7663 }
7664
7665 /**
7666 * Handler for 'wheel' event

Callers 1

_onKeydownMethod · 0.95

Calls 2

throwErrorMethod · 0.80

Tested by

no test coverage detected