I have implemented accordion layout which can expand and collapse on a click of a button.
Logic work’s perfectly fine, but performance is bit slow. On expand/Collapse of the content, instantly the height of the scroll is not getting calculated. user has to wait at-least a sec to see the effect.
i have attached codepen, please review the code and suggest to increase the performance.