MCPcopy Create free account
hub / github.com/Kong/insomnia / scrollElementIntoView

Function scrollElementIntoView

packages/insomnia/src/ui/utils.ts:9–14  ·  view source on GitHub ↗
(element: HTMLElement, options?: ScrollIntoViewOptions)

Source from the content-addressed store, hash-verified

7};
8
9export const scrollElementIntoView = (element: HTMLElement, options?: ScrollIntoViewOptions) => {
10 if (element) {
11 // @ts-expect-error -- scrollIntoViewIfNeeded is not a standard method
12 element.scrollIntoViewIfNeeded ? element.scrollIntoViewIfNeeded() : element.scrollIntoView(options);
13 }
14};
15
16// modify base on react-spectrum
17// https://github.com/adobe/react-spectrum/blob/main/packages/%40react-stately/data/src/useListData.ts#L279

Callers 1

InsomniaTabFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected