Make clicking on the account and status column headers scroll to top
This commit is contained in:
@ -43,6 +43,10 @@ export default class Following extends ImmutablePureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
handleHeaderClick = () => {
|
||||
this.column.scrollTop();
|
||||
}
|
||||
|
||||
handleScroll = (e) => {
|
||||
const { scrollTop, scrollHeight, clientHeight } = e.target;
|
||||
|
||||
@ -61,6 +65,10 @@ export default class Following extends ImmutablePureComponent {
|
||||
return !(location.state && location.state.mastodonModalOpen);
|
||||
}
|
||||
|
||||
setRef = c => {
|
||||
this.column = c;
|
||||
}
|
||||
|
||||
render () {
|
||||
const { accountIds, hasMore } = this.props;
|
||||
|
||||
@ -79,8 +87,8 @@ export default class Following extends ImmutablePureComponent {
|
||||
}
|
||||
|
||||
return (
|
||||
<Column>
|
||||
<ProfileColumnHeader />
|
||||
<Column ref={this.setRef}>
|
||||
<ProfileColumnHeader onClick={this.handleHeaderClick} />
|
||||
|
||||
<ScrollContainer scrollKey='following' shouldUpdateScroll={this.shouldUpdateScroll}>
|
||||
<div className='scrollable' onScroll={this.handleScroll}>
|
||||
|
Reference in New Issue
Block a user