MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / onMove

Method onMove

core/src/components/range/range.tsx:520–549  ·  view source on GitHub ↗

* The value should be updated while dragging the * bar or knob. * * While the user is dragging, the view * should not scroll. This is to prevent the user from * feeling disoriented while dragging. * * The user can scroll on the view if the knob or * bar is not being dragged.

(detail: GestureDetail)

Source from the content-addressed store, hash-verified

518 * @param detail The details of the gesture event.
519 */
520 private onMove(detail: GestureDetail) {
521 const { contentEl, pressedKnob } = this;
522 const currentX = detail.currentX;
523
524 /**
525 * Since the user is dragging on the bar or knob, the view should not scroll.
526 *
527 * This only needs to be done once.
528 */
529 if (contentEl && this.pressedKnob === undefined) {
530 this.initialContentScrollY = disableContentScrollY(contentEl);
531 }
532
533 /**
534 * The `pressedKnob` can be undefined if the user just
535 * started dragging the knob.
536 *
537 * This is necessary to determine which knob the user is dragging,
538 * especially when using dual knobs.
539 * Plus, it determines when to apply certain styles.
540 *
541 * This only needs to be done once since the knob won't change
542 * while the user is dragging.
543 */
544 if (pressedKnob === undefined) {
545 this.setPressedKnob(currentX);
546 }
547
548 this.update(currentX);
549 }
550
551 /**
552 * The value should be updated on touch end:

Callers 1

RangeClass · 0.95

Calls 3

setPressedKnobMethod · 0.95
updateMethod · 0.95
disableContentScrollYFunction · 0.90

Tested by

no test coverage detected