MCPcopy Create free account
hub / github.com/danvk/webdiff / scrollIntoViewIfNeeded

Function scrollIntoViewIfNeeded

ts/codediff/dom-utils.ts:86–93  ·  view source on GitHub ↗
(el: Element)

Source from the content-addressed store, hash-verified

84
85/** scrollIntoViewIfNeeded has nicer behavior than the web standard, but is non-standard. */
86export function scrollIntoViewIfNeeded(el: Element) {
87 const wkEl = el as WebkitElement;
88 if (wkEl.scrollIntoViewIfNeeded) {
89 wkEl.scrollIntoViewIfNeeded();
90 } else {
91 wkEl.scrollIntoView({block: 'nearest'});
92 }
93}

Callers 2

DiffRowFunction · 0.90
SkipRowFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected