Merge branch 'chats-keyboard-mobile' into 'develop'

Chats: fix #418 scrolling resize issue

Closes #418

See merge request soapbox-pub/soapbox-fe!233
better-alerts
Alex Gleason 2020-09-12 03:56:32 +00:00
commit c2ae225db1
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -89,11 +89,16 @@ class ChatMessageList extends ImmutablePureComponent {
return scrollBottom < elem.offsetHeight * 1.5;
}
handleResize = (e) => {
if (this.isNearBottom()) this.scrollToBottom();
}
componentDidMount() {
const { dispatch, chatId } = this.props;
dispatch(fetchChatMessages(chatId));
this.node.addEventListener('scroll', this.handleScroll);
window.addEventListener('resize', this.handleResize);
this.scrollToBottom();
}
@ -125,6 +130,7 @@ class ChatMessageList extends ImmutablePureComponent {
componentWillUnmount() {
this.node.removeEventListener('scroll', this.handleScroll);
window.removeEventListener('resize', this.handleResize);
}
handleLoadMore = () => {