UNPKG

@backstage/plugin-techdocs

Version:

The Backstage plugin that renders technical documentation for your components

22 lines (20 loc) 644 B
const scrollIntoNavigation = () => { return (dom) => { setTimeout(() => { const activeNavItems = dom?.querySelectorAll(`li.md-nav__item--active`); if (activeNavItems.length !== 0) { activeNavItems.forEach((activeNavItem) => { const checkbox = activeNavItem?.querySelector("input"); if (!checkbox?.checked) { checkbox?.click(); } }); const lastItem = activeNavItems[activeNavItems.length - 1]; lastItem.scrollIntoView(); } }, 200); return dom; }; }; export { scrollIntoNavigation }; //# sourceMappingURL=scrollIntoNavigation.esm.js.map