let mobileHeight = window.innerHeight-64;
if (this.props.conf.isMobile) {
//set height of chat messages area
let messagesElement = document.getElementsByClassName('chat')[0] as HTMLElement;
//set height
messagesElement.style.height = mobileHeight+'px';
//scroll messages to bottom
this.scrollToBottom();
}
};
componentDidMount() {
window.addEventListener('resize', this.handleKeyboardAvoiding);
this.scrollToBottom();
}
componentDidUpdate() {
this.scrollToBottom();
}
componentWillUnmount() {
window.removeEventListener('resize', this.handleKeyboardAvoiding);
}
Last active
August 19, 2019 09:08
-
-
Save miyasinarafat/3b1e4b3c5d137b6e3d7674f4f8bc46d7 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment