mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-28 19:10:22 -05:00
[Glitch] Fix clicking “Explore” or “Live feeds” column headers to scroll in advanced mode
Port e90649b064
to glitch-soc
Co-authored-by: Plastikmensch <Plastikmensch@users.noreply.github.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
66e82cb8e1
commit
685270f3f7
@ -18,7 +18,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;
|
||||
|
Loading…
Reference in New Issue
Block a user