diff --git a/src/utils/utils.ts b/src/utils/utils.ts index cc6a35f2ab..5b452f9964 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -320,7 +320,9 @@ function increaseHeightByContent(element: HTMLElement, getComputedStyle?: (elt: const style = getComputedStyle(element); element.style.height = "auto"; - element.style.height = (element.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth)) + "px"; + if(!!element.scrollHeight) { + element.style.height = (element.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth)) + "px"; + } } function getOriginalEvent(event: any) { return event.originalEvent || event;