Prevent pinned columns from scroll to top on URL changing (#3586)
This commit is contained in:
parent
1f1d6bf2a0
commit
c26cea262b
6 changed files with 27 additions and 9 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue