MCPcopy Create free account
hub / github.com/adobe/react-spectrum / scrollIntoView

Function scrollIntoView

packages/react-aria/src/utils/scrollIntoView.ts:33–44  ·  view source on GitHub ↗
(
  scrollView: HTMLElement,
  element: HTMLElement,
  opts: ScrollIntoViewOpts = {}
)

Source from the content-addressed store, hash-verified

31 * but doesn't affect parents above `scrollView`.
32 */
33export function scrollIntoView(
34 scrollView: HTMLElement,
35 element: HTMLElement,
36 opts: ScrollIntoViewOpts = {}
37): void {
38 if (scrollView === element) {
39 return;
40 }
41
42 let target = element.getBoundingClientRect();
43 scrollRectIntoView(scrollView, element, target, opts);
44}
45
46export function scrollRectIntoView(
47 scrollView: HTMLElement,

Callers 6

useSelectableCollectionFunction · 0.90
NavigationTree.tsxFile · 0.90
triggerScrollFunction · 0.90
TableVirtualizerFunction · 0.90
scrollIntoViewportFunction · 0.70

Calls 1

scrollRectIntoViewFunction · 0.85

Tested by

no test coverage detected