diff options
author | ThibG <thib@sitedethib.com> | 2020-07-09 15:09:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 15:09:19 +0200 |
commit | 6fda3cbbebfdc7b050f4437b996b2ad36c1db64c (patch) | |
tree | 7a3831f14548361e2515d0e9ced6a3f3b1c812e3 /app/javascript/mastodon/features/direct_timeline/components/conversation.js | |
parent | 61c07c37317f01c1ab4981826704750fe9937fe7 (diff) |
Freeze scroll position when a dropdown menu is open in the TL (#14271)
* Freeze scroll position when a dropdown menu is open in the TL * Apply this to direct TL as well * Fix case when mouse leaves the menu
Diffstat (limited to 'app/javascript/mastodon/features/direct_timeline/components/conversation.js')
-rw-r--r-- | app/javascript/mastodon/features/direct_timeline/components/conversation.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversation.js b/app/javascript/mastodon/features/direct_timeline/components/conversation.js index f9e45067f..6ecc27fac 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversation.js +++ b/app/javascript/mastodon/features/direct_timeline/components/conversation.js @@ -36,6 +36,7 @@ class Conversation extends ImmutablePureComponent { accounts: ImmutablePropTypes.list.isRequired, lastStatus: ImmutablePropTypes.map, unread:PropTypes.bool.isRequired, + scrollKey: PropTypes.string, onMoveUp: PropTypes.func, onMoveDown: PropTypes.func, markRead: PropTypes.func.isRequired, @@ -127,7 +128,7 @@ class Conversation extends ImmutablePureComponent { } render () { - const { accounts, lastStatus, unread, intl } = this.props; + const { accounts, lastStatus, unread, scrollKey, intl } = this.props; if (lastStatus === null) { return null; @@ -194,7 +195,15 @@ class Conversation extends ImmutablePureComponent { <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.reply)} icon='reply' onClick={this.handleReply} /> <div className='status__action-bar-dropdown'> - <DropdownMenuContainer status={lastStatus} items={menu} icon='ellipsis-h' size={18} direction='right' title={intl.formatMessage(messages.more)} /> + <DropdownMenuContainer + scrollKey={scrollKey} + status={lastStatus} + items={menu} + icon='ellipsis-h' + size={18} + direction='right' + title={intl.formatMessage(messages.more)} + /> </div> </div> </div> |