0
0
Fork 0

Prevent pinned columns from scroll to top on URL changing (#3586)

This commit is contained in:
unarist 2017-06-05 22:20:46 +09:00 committed by Eugen Rochko
parent 1f1d6bf2a0
commit c26cea262b
6 changed files with 27 additions and 9 deletions

View file

@ -119,6 +119,7 @@ class Notifications extends React.PureComponent {
let loadMore = '';
let scrollableArea = '';
let unread = '';
let scrollContainer = '';
if (!isLoading && notifications.size > 0) {
loadMore = <LoadMore onClick={this.handleLoadMore} />;
@ -149,6 +150,16 @@ class Notifications extends React.PureComponent {
);
}
if (pinned) {
scrollContainer = scrollableArea;
} else {
scrollContainer = (
<ScrollContainer scrollKey={`notifications-${columnId}`} shouldUpdateScroll={shouldUpdateScroll}>
{scrollableArea}
</ScrollContainer>
);
}
this.scrollableArea = scrollableArea;
return (
@ -166,9 +177,7 @@ class Notifications extends React.PureComponent {
<ColumnSettingsContainer />
</ColumnHeader>
<ScrollContainer scrollKey={`notifications-${columnId}`} shouldUpdateScroll={shouldUpdateScroll}>
{scrollableArea}
</ScrollContainer>
{scrollContainer}
</Column>
);
}