diff --git a/src/Utils.ts b/src/Utils.ts index 73e67ed43..7185b2ddc 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -1450,7 +1450,10 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be public static scrollIntoView(element: HTMLBaseElement | HTMLDivElement) { // Is the element completely in the view? - const parentRect = Utils.findParentWithScrolling(element).getBoundingClientRect() + const parentRect = Utils.findParentWithScrolling(element)?.getBoundingClientRect() + if(!parentRect){ + return + } const elementRect = element.getBoundingClientRect() // Check if the element is within the vertical bounds of the parent element