diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2018-07-29 23:52:06 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-07-29 16:52:06 +0200 |
commit | 06c83527f5e4b7c8460f7d4a62322d2b8e805056 (patch) | |
tree | 4f78cae7f5954993299c84996eb314152d9a3abe /app/javascript/mastodon/features/blocks/index.js | |
parent | 0a3cc246acca9645d5d41a25d73f510ff67af6f6 (diff) |
Do not scroll up when modal is opened (#8095)
Diffstat (limited to 'app/javascript/mastodon/features/blocks/index.js')
-rw-r--r-- | app/javascript/mastodon/features/blocks/index.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/javascript/mastodon/features/blocks/index.js b/app/javascript/mastodon/features/blocks/index.js index 14a512ae8..0b88e50ae 100644 --- a/app/javascript/mastodon/features/blocks/index.js +++ b/app/javascript/mastodon/features/blocks/index.js @@ -1,5 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; +import { defineMessages, injectIntl } from 'react-intl'; +import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import LoadingIndicator from '../../components/loading_indicator'; @@ -8,8 +10,6 @@ import Column from '../ui/components/column'; import ColumnBackButtonSlim from '../../components/column_back_button_slim'; import AccountContainer from '../../containers/account_container'; import { fetchBlocks, expandBlocks } from '../../actions/blocks'; -import { defineMessages, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; const messages = defineMessages({ heading: { id: 'column.blocks', defaultMessage: 'Blocked users' }, @@ -26,6 +26,7 @@ export default class Blocks extends ImmutablePureComponent { static propTypes = { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, + shouldUpdateScroll: PropTypes.func, accountIds: ImmutablePropTypes.list, intl: PropTypes.object.isRequired, }; @@ -43,7 +44,7 @@ export default class Blocks extends ImmutablePureComponent { } render () { - const { intl, accountIds } = this.props; + const { intl, accountIds, shouldUpdateScroll } = this.props; if (!accountIds) { return ( @@ -56,7 +57,7 @@ export default class Blocks extends ImmutablePureComponent { return ( <Column icon='ban' heading={intl.formatMessage(messages.heading)}> <ColumnBackButtonSlim /> - <ScrollContainer scrollKey='blocks'> + <ScrollContainer scrollKey='blocks' shouldUpdateScroll={shouldUpdateScroll}> <div className='scrollable' onScroll={this.handleScroll}> {accountIds.map(id => <AccountContainer key={id} id={id} /> |