Skip to content

Instantly share code, notes, and snippets.

@NoamELB
Created November 18, 2017 17:33
Show Gist options
  • Save NoamELB/e6361103849868164f635e7d1d150f63 to your computer and use it in GitHub Desktop.
Save NoamELB/e6361103849868164f635e7d1d150f63 to your computer and use it in GitHub Desktop.
update height on a Collapse component
updateHeight(isOpen) {
if (isOpen) {
this.containerEl.style.height = `${this.contentEl.scrollHeight}px`;
} else {
this.containerEl.style.height = '0px';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment