app/javascript/js/controllers/sidebar_controller.js in avo-3.6.4 vs app/javascript/js/controllers/sidebar_controller.js in avo-3.8.0
- old
+ new
@@ -19,10 +19,10 @@
// Used on initial page load to scroll to the first active sidebar item if it's not in view.
function scrollSidebarMenuItemIntoView() {
const activeSidebarItem = document.querySelector('.avo-sidebar .mac-styled-scrollbar a.active')
const sidebarScrollingArea = document.querySelector('.avo-sidebar .mac-styled-scrollbar')
- if (!isInViewport(activeSidebarItem, sidebarScrollingArea)) {
+ if (activeSidebarItem && !isInViewport(activeSidebarItem, sidebarScrollingArea)) {
activeSidebarItem.scrollIntoView({ block: 'end', inline: 'nearest' })
}
}
export default class extends Controller {