Skip to content

Commit

Permalink
Fix clicking “Explore” or “Live feeds” column headers to scroll in ad…
Browse files Browse the repository at this point in the history
…vanced mode (mastodon#26633)

Co-authored-by: Plastikmensch <Plastikmensch@users.noreply.github.com>
  • Loading branch information
2 people authored and vmstan committed Jan 5, 2024
1 parent afb11e2 commit ee67aa9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/javascript/mastodon/components/column.jsx
Expand Up @@ -16,7 +16,19 @@ export default class Column extends PureComponent {
};

scrollTop () {
const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable');
let scrollable = null;

if (this.props.bindToDocument) {
scrollable = document.scrollingElement;
} else {
scrollable = this.node.querySelector('.scrollable');

// Some columns have nested `.scrollable` containers, with the outer one
// being a wrapper while the actual scrollable content is deeper.
if (scrollable.classList.contains('scrollable--flex')) {
scrollable = scrollable?.querySelector('.scrollable') || scrollable;
}
}

if (!scrollable) {
return;
Expand Down

0 comments on commit ee67aa9

Please sign in to comment.