mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
15 lines
375 B
JavaScript
15 lines
375 B
JavaScript
import _scrollIntoViewIfNeeded from 'scroll-into-view-if-needed';
|
|
|
|
globalThis.DOM = globalThis.DOM || {};
|
|
|
|
export const scrollIntoViewIfNeeded = (el, overrides = {}) => {
|
|
const {
|
|
scroll = _scrollIntoViewIfNeeded,
|
|
} = overrides;
|
|
|
|
return scroll(el, {
|
|
block: 'nearest',
|
|
});
|
|
};
|
|
|
|
globalThis.DOM.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;
|