Closed mogottsch closed 1 year ago
I get this error message with the newest version when trying to render the sidebar without any active elements:
TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
I think the issue is in the isElementInViewport function. If el is undefined this line fails:
isElementInViewport
el
var rect = el.getBoundingClientRect();
It seems like the issue exists since this commit.
This fix works for me:
// Scroll into active sidebar setTimeout(() => { const activeSidebarItem = document.querySelector(".sidebar-item.active"); if (activeSidebarItem) { this.forceElementVisibility(activeSidebarItem); } }, 300);
I can create a PR if the fix is fine for you.
Yup, please :)
I created a PR here :)
Whoaa, great 👍 thanks for fixing it mate, I had the same issue
I get this error message with the newest version when trying to render the sidebar without any active elements:
I think the issue is in the
isElementInViewport
function. Ifel
is undefined this line fails:It seems like the issue exists since this commit.
This fix works for me: