UNPKG

tdesign-react

Version:
23 lines (19 loc) 566 B
/** * tdesign v1.15.1 * (c) 2025 tdesign * @license MIT */ import { f as elementInViewport, d as getWindowSize } from '../../_chunks/dep-3a09424a.js'; import { scrollTo } from '../../_util/scroll.js'; import 'lodash-es'; import 'raf'; import '../../_util/easing.js'; function scrollToElm(elm) { var rect = elm.getBoundingClientRect(); if (!elementInViewport(elm)) { var winHeight = getWindowSize().height; scrollTo(rect.top - (winHeight / 2 - rect.height / 2), {}); } } export { scrollToElm as default }; //# sourceMappingURL=scrollToElm.js.map