diff --git a/source/components/navigation/table-of-content.mjs b/source/components/navigation/table-of-content.mjs
index 6f44fa43fbfd3f51a293a08c44c29399c67ca199..862b4547efa475a2affde49affa14823c2b3a658 100644
--- a/source/components/navigation/table-of-content.mjs
+++ b/source/components/navigation/table-of-content.mjs
@@ -162,7 +162,7 @@ class TableOfContent extends CustomElement {
 			if (this[scrollableParentSymbol] === getWindow()) {
 				if (
 					["absolute", "relative", "fixed", "sticky"].indexOf(
-						this[scrollableParentSymbol].style.position,
+						this[scrollableParentSymbol]?.style?.position,
 					) === -1
 				) {
 					this.style.position = "relative";
@@ -176,7 +176,7 @@ class TableOfContent extends CustomElement {
 			} else {
 				if (
 					["absolute", "relative", "fixed", "sticky"].indexOf(
-						this[scrollableParentSymbol].style.position,
+						this[scrollableParentSymbol]?.style?.position,
 					) === -1
 				) {
 					this[scrollableParentSymbol].style.position = "relative";
@@ -229,6 +229,25 @@ class TableOfContent extends CustomElement {
 	}
 }
 
+/**
+ * @private
+ * @param element
+ * @returns {number|number|*|number}
+ */
+function getScrollHeight(element) {
+	
+	if (element instanceof ShadowRoot) {
+		return element.host.scrollHeight;
+	}
+	
+	if (element === getWindow()) {
+		return element.document.documentElement.scrollHeight;
+	}
+	
+	return element.scrollHeight;
+	
+}
+
 /**
  * @private
  * @return {void}
@@ -339,7 +358,7 @@ function initNavigation() {
 
 			this[scrollableParentSymbol].scrollTo(
 				0,
-				this[scrollableParentSymbol].scrollHeight,
+				getScrollHeight(this[scrollableParentSymbol]),
 			);
 		});
 		footer.appendChild(scrollToBottom);
@@ -428,7 +447,6 @@ function getHeadings() {
 			const headings = element.querySelectorAll("h1, h2, h3, h4, h5, h6");
 			let nodeList = Array.from(headings);
 
-			// remove all with attribute data-monster-table-of-content-omit
 			nodeList = nodeList.filter((node) => {
 				return !node.hasAttribute("data-monster-table-of-content-omit");
 			});