diff --git a/app/components/post_list/post_list.ios.js b/app/components/post_list/post_list.ios.js index e4ac1a203..4be27931f 100644 --- a/app/components/post_list/post_list.ios.js +++ b/app/components/post_list/post_list.ios.js @@ -4,10 +4,7 @@ import React from 'react'; import {FlatList, StyleSheet} from 'react-native'; -import {debounce} from 'mattermost-redux/actions/helpers'; - import {ListTypes} from 'app/constants'; -import {THREAD} from 'app/constants/screen'; import {makeExtraData} from 'app/utils/list_view'; import PostListBase from './post_list_base'; @@ -62,8 +59,8 @@ export default class PostList extends PostListBase { handleScroll = (event) => { const pageOffsetY = event.nativeEvent.contentOffset.y; - const contentHeight = event.nativeEvent.contentSize.height; if (pageOffsetY > 0) { + const contentHeight = event.nativeEvent.contentSize.height; const direction = (this.contentOffsetY < pageOffsetY) ? ListTypes.VISIBILITY_SCROLL_UP : ListTypes.VISIBILITY_SCROLL_DOWN; @@ -75,26 +72,9 @@ export default class PostList extends PostListBase { ) { this.props.onLoadMoreUp(); } - } else if (pageOffsetY < 0) { - if (this.state.postListHeight > contentHeight || this.props.location === THREAD) { - // Posting a message like multiline or jumbo emojis causes the FlatList component for iOS - // to render RefreshControl component and remain the space as is when it's unmounted, - // leaving a whitespace of ~64 units of height between input box and post list. - // This condition explicitly pull down the list to recent post when pageOffsetY is less than zero, - // and the height of the layout is greater than its content or is on a thread screen. - this.handleScrollToRecentPost(); - } } }; - handleScrollToRecentPost = debounce(() => { - this.refs.list.scrollToIndex({ - animated: true, - index: 0, - viewPosition: 1, - }); - }, 100); - handleScrollToIndexFailed = () => { requestAnimationFrame(() => { this.hasDoneInitialScroll = false; diff --git a/app/components/post_textbox/components/typing/typing.js b/app/components/post_textbox/components/typing/typing.js index a60a27f61..15f02df9b 100644 --- a/app/components/post_textbox/components/typing/typing.js +++ b/app/components/post_textbox/components/typing/typing.js @@ -32,11 +32,13 @@ export default class Typing extends PureComponent { } animateTyping = (show = false) => { - const height = show ? 20 : 0; + const [height, duration] = show ? + [20, 200] : + [0, 400]; Animated.timing(this.state.typingHeight, { toValue: height, - duration: 200, + duration, }).start(); }