Skip to content

Instantly share code, notes, and snippets.

@miyasinarafat
Last active August 19, 2019 09:08
Show Gist options
  • Save miyasinarafat/3b1e4b3c5d137b6e3d7674f4f8bc46d7 to your computer and use it in GitHub Desktop.
Save miyasinarafat/3b1e4b3c5d137b6e3d7674f4f8bc46d7 to your computer and use it in GitHub Desktop.

image of error

      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);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment