Merge branch 'chats-keyboard-mobile' into 'develop'
Chats: fix #418 scrolling resize issue Closes #418 See merge request soapbox-pub/soapbox-fe!233
This commit is contained in:
commit
c2ae225db1
1 changed files with 6 additions and 0 deletions
|
@ -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 = () => {
|
||||
|
|
Loading…
Reference in a new issue