MCPcopy
hub / github.com/flatpickr/flatpickr / incrementNumInput

Function incrementNumInput

src/index.ts:560–572  ·  view source on GitHub ↗

* Increments/decrements the value of input associ- * ated with the up/down arrow by dispatching an * "increment" event on the input. * * @param {Event} e the click event * @param {Number} delta the diff (usually 1 or -1) * @param {Element} inputElem the input element

(
    e: KeyboardEvent | MouseEvent | undefined,
    delta: number,
    inputElem?: HTMLInputElement
  )

Source from the content-addressed store, hash-verified

558 * @param {Element} inputElem the input element
559 */
560 function incrementNumInput(
561 e: KeyboardEvent | MouseEvent | undefined,
562 delta: number,
563 inputElem?: HTMLInputElement
564 ) {
565 const target = e && (getEventTarget(e) as Element);
566 const input =
567 inputElem ||
568 (target && target.parentNode && target.parentNode.firstChild);
569 const event = createEvent("increment") as IncrementEvent;
570 event.delta = delta;
571 input && input.dispatchEvent(event);
572 }
573
574 function build() {
575 const fragment = window.document.createDocumentFragment();

Callers 2

timeIncrementFunction · 0.85
timeWrapperFunction · 0.85

Calls 2

getEventTargetFunction · 0.90
createEventFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…