Created
November 18, 2017 17:33
-
-
Save NoamELB/e6361103849868164f635e7d1d150f63 to your computer and use it in GitHub Desktop.
update height on a Collapse component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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