I've seen this question and have not seen anyone provide this answer. The solution I created was perfect for my situation so I thought I'd share. Essentially, I had a page where a generated list was hidden at first by setting CSS height to "0" then expanded on click by transitioning height. However, transitions won't work with height = "auto". So I did some digging and realized that the CSS attribute "scrollHeight" will still calculate despite "height" or "max-height". So I set the "onclick" event to change the element height to the "scrollHeight".
document.getElementById('dropContent').style.height = document.getElementById('dropContent').scrollHeight + 'px';