Fix bug with scroll bars and wrapping content

This commit is contained in:
MatthiasSaihttam 2021-10-23 00:28:15 -04:00
parent d77d8d7f39
commit d67ea3f498
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@
function updateBoxHeight(box) {
//style.height doesn't include padding, .scrollHeight does
box.style.height = "auto";
// Set overflow hidden to ensure scrollbars aren't shown, since they change the width and thus the height
box.style.overflow = "hidden";
box.style.height = box.scrollHeight + "px";
}