MCPcopy
hub / github.com/shipshapecode/shepherd / _scrollTo

Method _scrollTo

shepherd.js/src/step.ts:628–639  ·  view source on GitHub ↗

* If a custom scrollToHandler is defined, call that, otherwise do the generic * scrollIntoView call. * * @param {boolean | ScrollIntoViewOptions} scrollToOptions - If true, uses the default `scrollIntoView`, * if an object, passes that object as the params to `scrollIntoView` i.e. `{ beh

(scrollToOptions: boolean | ScrollIntoViewOptions)

Source from the content-addressed store, hash-verified

626 * @private
627 */
628 _scrollTo(scrollToOptions: boolean | ScrollIntoViewOptions) {
629 const { element } = this._getResolvedAttachToOptions();
630
631 if (isFunction(this.options.scrollToHandler)) {
632 this.options.scrollToHandler(element as HTMLElement);
633 } else if (
634 isElement(element) &&
635 typeof element.scrollIntoView === 'function'
636 ) {
637 element.scrollIntoView(scrollToOptions);
638 }
639 }
640
641 /**
642 * _getClassOptions gets all possible classes for the step

Callers 2

_showMethod · 0.95
step.spec.jsFile · 0.80

Calls 3

isFunctionFunction · 0.90
isElementFunction · 0.90

Tested by

no test coverage detected